Skip to content

A community-supported supercharged document management system: scan, index and archive all your documents

skip test if dir exists

florian on nixos (Florian Brandes)b5f77fd6e7b4
diff --git a/src/documents/tests/test_tasks.py b/src/documents/tests/test_tasks.py
index fcb6909ff..a23e00c93 100644
--- a/src/documents/tests/test_tasks.py
+++ b/src/documents/tests/test_tasks.py
@@ -144,7 +144,9 @@ class TestTasks(DirectoriesMixin, TestCase):
os.path.dirname(__file__), "samples", "patch-code-t.pdf"
)
nonexistingdir = "/nowhere"
- if not os.path.isdir(nonexistingdir):
+ if os.path.isdir(nonexistingdir):
+ self.skipTest("non-existing dir exists")
+ else:
with self.assertLogs("paperless.tasks", level="WARNING") as cm:
tasks.save_to_dir(test_file, nonexistingdir)
self.assertEqual(