From 8dca8f3c9f3ca09bfa11fb1b322a4707c098bab6 Mon Sep 17 00:00:00 2001 From: Ronny Pfannschmidt Date: Wed, 17 Oct 2018 21:16:44 +0200 Subject: [PATCH 1/2] fix test_cleanup_keep for expecting symlinks --- testing/test_tmpdir.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testing/test_tmpdir.py b/testing/test_tmpdir.py index 441714528..f1b6fe424 100644 --- a/testing/test_tmpdir.py +++ b/testing/test_tmpdir.py @@ -248,7 +248,7 @@ class TestNumberedDir(object): def test_cleanup_keep(self, tmp_path): self._do_cleanup(tmp_path) - a, b = tmp_path.iterdir() + a, b = (x for x in tmp_path.iterdir() if not x.is_symlink()) print(a, b) def test_cleanup_locked(self, tmp_path): From 56dd7bc551f739a00795ab866578ce3789fa572e Mon Sep 17 00:00:00 2001 From: Ronny Pfannschmidt Date: Wed, 17 Oct 2018 21:39:23 +0200 Subject: [PATCH 2/2] TestNumberedDir: ignore that symlinks arent created on windows --- testing/test_tmpdir.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/testing/test_tmpdir.py b/testing/test_tmpdir.py index f1b6fe424..3c413e7c2 100644 --- a/testing/test_tmpdir.py +++ b/testing/test_tmpdir.py @@ -197,8 +197,10 @@ class TestNumberedDir(object): assert d.name.endswith(str(i)) symlink = tmp_path.joinpath(self.PREFIX + "current") - assert symlink.is_symlink() - assert symlink.resolve() == d.resolve() + if symlink.exists(): + # unix + assert symlink.is_symlink() + assert symlink.resolve() == d.resolve() def test_cleanup_lock_create(self, tmp_path): d = tmp_path.joinpath("test")