Skip to content

Commit

Permalink
Skip the numpy doctests.
Browse files Browse the repository at this point in the history
They seem like more trouble that they're worth.
  • Loading branch information
kalekundert committed Jun 15, 2017
1 parent b41852c commit 5076955
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
3 changes: 2 additions & 1 deletion _pytest/python_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,8 @@ def approx(expected, rel=None, abs=None, nan_ok=False):
And ``numpy`` arrays::
>>> np.array([0.1, 0.2]) + np.array([0.2, 0.4]) == approx(np.array([0.3, 0.6]))
>>> import numpy as np # doctest: +SKIP
>>> np.array([0.1, 0.2]) + np.array([0.2, 0.4]) == approx(np.array([0.3, 0.6])) # doctest: +SKIP
True
By default, ``approx`` considers numbers within a relative tolerance of
Expand Down
3 changes: 1 addition & 2 deletions testing/python/approx.py
Original file line number Diff line number Diff line change
Expand Up @@ -350,11 +350,10 @@ def test_numpy_array_wrong_shape(self):
assert a21 != approx(a12)

def test_doctests(self):
np = pytest.importorskip('numpy')
parser = doctest.DocTestParser()
test = parser.get_doctest(
approx.__doc__,
{'approx': approx ,'np': np},
{'approx': approx},
approx.__name__,
None, None,
)
Expand Down

0 comments on commit 5076955

Please sign in to comment.