summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGard Spreemann <gspr@nonempty.org>2020-12-17 14:48:06 +0100
committerGard Spreemann <gspr@nonempty.org>2020-12-17 14:48:06 +0100
commit8d5f72c2b58901fdfa35addbba9c2de7e5abc486 (patch)
tree40b96a1fbb0796cd966db9f28242762e0b06936f
parentffa79d8f6a1e0ebdc6e6de362af7a4195a1b63a4 (diff)
Make some tests ignored instead of disabled.
This is needed because their Python imports already fail.
-rw-r--r--debian/changelog1
-rw-r--r--debian/tests/upstream.py18
2 files changed, 13 insertions, 6 deletions
diff --git a/debian/changelog b/debian/changelog
index 1916df50..3e121915 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -3,6 +3,7 @@ gudhi (3.4.0+dfsg-1) UNRELEASED; urgency=medium
* New upstream version.
- Disable new test that requires PyTorch and TensorFlow.
* Standards-version 4.5.1, no changes needed.
+ * Prevent some tests from even loading, as their imports fail.
-- Gard Spreemann <gspr@nonempty.org> Wed, 16 Dec 2020 15:22:03 +0100
diff --git a/debian/tests/upstream.py b/debian/tests/upstream.py
index 3c23027c..51265ec0 100644
--- a/debian/tests/upstream.py
+++ b/debian/tests/upstream.py
@@ -2,19 +2,25 @@ import sys
import itertools
import pytest
-blacklist = ["test_dtm.py", # Requires hnswlib
- "test_knn.py", # Requires pykeops
+blacklist = ["test_knn.py", # Requires pykeops
"test_representations.py", # Look into this
"test_tomato.py", # Wants to use X.
- "test_wasserstein_distance.py::test_wasserstein_distance_grad", # Requires PyTorch.
- "test_wasserstein_with_tensors.py" # Requires PyTorch and TF.
- ]
+ "test_wasserstein_distance.py::test_wasserstein_distance_grad" # Requires PyTorch.
+ ]
print("Blacklist: %s" %(str(blacklist)))
+# These should be completely ignored, not even loaded (their imports fail).
+ignorelist = ["test_dtm.py", # Requires hnswlib.
+ "test_wasserstein_with_tensors.py" # Requires PyTorch and TF
+ ]
+
+print("Ignorelist:", ignorelist)
+
testdir = sys.argv[1]
deselect_args = list(itertools.chain.from_iterable([["--deselect", "%s/%s" %(testdir, exclude)] for exclude in blacklist]))
+ignore_args = list(itertools.chain.from_iterable([["--ignore-glob", "%s/%s" %(testdir, exclude)] for exclude in ignorelist]))
-exitcode = pytest.main([testdir] + deselect_args)
+exitcode = pytest.main([testdir] + deselect_args + ignore_args)
exit(exitcode)