summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc Glisse <marc.glisse@inria.fr>2019-11-15 22:23:21 +0100
committerMarc Glisse <marc.glisse@inria.fr>2019-11-15 22:23:21 +0100
commitb2d81dd8ee2ed7e1269eb16816f9af6794305046 (patch)
tree92bd5f95ddc10bdad314a436d49182ce9f1c92c4
parenta043bee376c25254bd413c5579e9611aa57dbf47 (diff)
Run example as a test, without graphics
-rw-r--r--src/python/CMakeLists.txt5
-rwxr-xr-xsrc/python/example/diagram_vectorizations_distances_kernels.py (renamed from src/python/example/ex_diagrams.py)0
-rwxr-xr-xsrc/python/test/test_representations.py11
3 files changed, 16 insertions, 0 deletions
diff --git a/src/python/CMakeLists.txt b/src/python/CMakeLists.txt
index 5e2207f0..d131b920 100644
--- a/src/python/CMakeLists.txt
+++ b/src/python/CMakeLists.txt
@@ -387,6 +387,11 @@ if(PYTHONINTERP_FOUND)
add_gudhi_py_test(test_wasserstein_distance)
endif(OT_FOUND)
+ # Representations
+ if(SKLEARN_FOUND)
+ add_gudhi_py_test(test_representations)
+ endif(SKLEARN_FOUND)
+
# Documentation generation is available through sphinx - requires all modules
if(SPHINX_PATH)
if(MATPLOTLIB_FOUND)
diff --git a/src/python/example/ex_diagrams.py b/src/python/example/diagram_vectorizations_distances_kernels.py
index a6a36b7c..a6a36b7c 100755
--- a/src/python/example/ex_diagrams.py
+++ b/src/python/example/diagram_vectorizations_distances_kernels.py
diff --git a/src/python/test/test_representations.py b/src/python/test/test_representations.py
new file mode 100755
index 00000000..4ff65f98
--- /dev/null
+++ b/src/python/test/test_representations.py
@@ -0,0 +1,11 @@
+import os
+import sys
+import matplotlib.pyplot as plt
+# Disable graphics for testing purposes
+plt.show = lambda:None
+here = os.path.dirname(os.path.realpath(__file__))
+sys.path.append(here + "/../example")
+import diagram_vectorizations_distances_kernels
+# pytest is unhappy if there are 0 tests
+def test_nothing():
+ return None