Skip to content

Commit d3236cf

Browse files
committed
test raise with pytets in test_emd_1d_emd2_1d
1 parent e26aa8e commit d3236cf

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,10 @@ pep8 :
4242
flake8 examples/ ot/ test/
4343

4444
test : FORCE pep8
45-
$(PYTHON) -m pytest -v test/ --cov=ot --cov-report html:cov_html
45+
$(PYTHON) -m pytest -v test/ --doctest-modules --ignore ot/gpu/ --cov=ot --cov-report html:cov_html
4646

4747
pytest : FORCE
48-
$(PYTHON) -m pytest -v test/ --cov=ot
48+
$(PYTHON) -m pytest -v test/ --doctest-modules --ignore ot/gpu/ --cov=ot
4949

5050
uploadpypi :
5151
#python setup.py register

ot/__init__.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,10 @@
1010
:py:mod:`ot.gromov`, :py:mod:`ot.smooth`
1111
:py:mod:`ot.stochastic`
1212
13-
The other sub-modules are not imported due to additional dependencies.
13+
The following sub-modules are not imported due to additional dependencies:
14+
15+
- :any:`ot.dr` : depends on :code:`pymanopt` and :code:`autograd`.
16+
- :any:`ot.gpu` : depends on :code:`cupy` and a CUDA GPU.
1417
1518
"""
1619

test/test_ot.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,8 @@ def test_emd_1d_emd2_1d():
7272
# check AssertionError is raised if called on non 1d arrays
7373
u = np.random.randn(n, 2)
7474
v = np.random.randn(m, 2)
75-
np.testing.assert_raises(AssertionError, ot.emd_1d, u, v, [], [])
75+
with pytest.raises(AssertionError):
76+
ot.emd_1d(u, v, [], [])
7677

7778

7879
def test_wass_1d():

0 commit comments

Comments
 (0)