Skip to content

Commit 5076955

Browse files
committed
Skip the numpy doctests.
They seem like more trouble that they're worth.
1 parent b41852c commit 5076955

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

_pytest/python_api.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,8 @@ def approx(expected, rel=None, abs=None, nan_ok=False):
315315
316316
And ``numpy`` arrays::
317317
318-
>>> np.array([0.1, 0.2]) + np.array([0.2, 0.4]) == approx(np.array([0.3, 0.6]))
318+
>>> import numpy as np # doctest: +SKIP
319+
>>> np.array([0.1, 0.2]) + np.array([0.2, 0.4]) == approx(np.array([0.3, 0.6])) # doctest: +SKIP
319320
True
320321
321322
By default, ``approx`` considers numbers within a relative tolerance of

testing/python/approx.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -350,11 +350,10 @@ def test_numpy_array_wrong_shape(self):
350350
assert a21 != approx(a12)
351351

352352
def test_doctests(self):
353-
np = pytest.importorskip('numpy')
354353
parser = doctest.DocTestParser()
355354
test = parser.get_doctest(
356355
approx.__doc__,
357-
{'approx': approx ,'np': np},
356+
{'approx': approx},
358357
approx.__name__,
359358
None, None,
360359
)

0 commit comments

Comments
 (0)