diff options
author | Rémi Flamary <remi.flamary@gmail.com> | 2019-07-03 13:31:55 +0200 |
---|---|---|
committer | Rémi Flamary <remi.flamary@gmail.com> | 2019-07-03 13:31:55 +0200 |
commit | d3236cf0cab000b5604f8ede9ebcbdc19d8c213f (patch) | |
tree | fe7c1499c3c8afa5c2edd82758c2e643c16cd883 | |
parent | e26aa8ee4498f19248f8dcc9868ec55b62eb35e5 (diff) |
test raise with pytets in test_emd_1d_emd2_1d
-rw-r--r-- | Makefile | 4 | ||||
-rw-r--r-- | ot/__init__.py | 5 | ||||
-rw-r--r-- | test/test_ot.py | 3 |
3 files changed, 8 insertions, 4 deletions
@@ -42,10 +42,10 @@ pep8 : flake8 examples/ ot/ test/ test : FORCE pep8 - $(PYTHON) -m pytest -v test/ --cov=ot --cov-report html:cov_html + $(PYTHON) -m pytest -v test/ --doctest-modules --ignore ot/gpu/ --cov=ot --cov-report html:cov_html pytest : FORCE - $(PYTHON) -m pytest -v test/ --cov=ot + $(PYTHON) -m pytest -v test/ --doctest-modules --ignore ot/gpu/ --cov=ot uploadpypi : #python setup.py register diff --git a/ot/__init__.py b/ot/__init__.py index ad7b982..35d2ddd 100644 --- a/ot/__init__.py +++ b/ot/__init__.py @@ -10,7 +10,10 @@ a number of functions described below. :py:mod:`ot.gromov`, :py:mod:`ot.smooth` :py:mod:`ot.stochastic` - The other sub-modules are not imported due to additional dependencies. + The following sub-modules are not imported due to additional dependencies: + + - :any:`ot.dr` : depends on :code:`pymanopt` and :code:`autograd`. + - :any:`ot.gpu` : depends on :code:`cupy` and a CUDA GPU. """ diff --git a/test/test_ot.py b/test/test_ot.py index ac86602..dacae0a 100644 --- a/test/test_ot.py +++ b/test/test_ot.py @@ -72,7 +72,8 @@ def test_emd_1d_emd2_1d(): # check AssertionError is raised if called on non 1d arrays u = np.random.randn(n, 2) v = np.random.randn(m, 2) - np.testing.assert_raises(AssertionError, ot.emd_1d, u, v, [], []) + with pytest.raises(AssertionError): + ot.emd_1d(u, v, [], []) def test_wass_1d(): |