]> git.ipfire.org Git - thirdparty/paperless-ngx.git/commitdiff
skip test if dir exists
authorflorian on nixos (Florian Brandes) <florian.brandes@posteo.de>
Thu, 24 Mar 2022 11:24:26 +0000 (12:24 +0100)
committerFlorian Brandes <florian.brandes@posteo.de>
Wed, 6 Apr 2022 19:16:41 +0000 (21:16 +0200)
Signed-off-by: florian on nixos (Florian Brandes) <florian.brandes@posteo.de>
src/documents/tests/test_tasks.py

index fcb6909ff9a95e7acb9a9e5caa6add156a0b9051..a23e00c936b624c057d9915972e01dcb0eaaf5e6 100644 (file)
@@ -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(