From 0efbb037d2d1c10178448bac2cb2b9ae8b9effd4 Mon Sep 17 00:00:00 2001 From: cpburnz <2126043+cpburnz@users.noreply.github.com> Date: Mon, 11 Sep 2023 19:35:34 -0400 Subject: [PATCH] realpath bug fixed in Python 3.8 --- tests/test_01_util.py | 35 ----------------------------------- 1 file changed, 35 deletions(-) diff --git a/tests/test_01_util.py b/tests/test_01_util.py index 74cc4f8..ee77ee5 100644 --- a/tests/test_01_util.py +++ b/tests/test_01_util.py @@ -64,14 +64,6 @@ def require_islink_dir(self) -> None: if self.broken_islink_dir: raise unittest.SkipTest("`os.path.islink` is broken for directories.") - def require_realpath(self) -> None: - """ - Skips the test if `os.path.realpath` does not properly support - symlinks. - """ - if self.broken_realpath: - raise unittest.SkipTest("`os.path.realpath` is broken.") - def require_symlink(self) -> None: """ Skips the test if `os.symlink` is not supported. @@ -140,31 +132,6 @@ def test_02_link_1_check_1_symlink(self): finally: self.__class__.no_symlink = no_symlink - def test_02_link_1_check_2_realpath(self): - """ - Tests whether `os.path.realpath` works properly with symlinks. - """ - # NOTE: Windows does not follow symlinks with `os.path.realpath` - # which is what we use to detect recursion. See - # for details. - broken_realpath: Optional[bool] = None - try: - self.require_symlink() - file = self.temp_dir / 'file' - link = self.temp_dir / 'link' - mkfile(file) - os.symlink(file, link) - - try: - self.assertEqual(os.path.realpath(file), os.path.realpath(link)) - except AssertionError: - broken_realpath = True - else: - broken_realpath = False - - finally: - self.__class__.broken_realpath = broken_realpath - def test_02_link_1_check_3_islink(self): """ Tests whether `os.path.islink` works properly with symlinks to directories. @@ -269,7 +236,6 @@ def test_02_link_4_recursive_links(self): Tests detection of recursive links. """ self.require_symlink() - self.require_realpath() self.require_islink_dir() self.make_dirs([ 'Dir', @@ -291,7 +257,6 @@ def test_02_link_5_recursive_circular_links(self): Tests detection of recursion through circular links. """ self.require_symlink() - self.require_realpath() self.require_islink_dir() self.make_dirs([ 'A',