From 50769557e820e3b58d00d2727c9355d6d8dd6833 Mon Sep 17 00:00:00 2001 From: Kale Kundert Date: Thu, 15 Jun 2017 14:53:27 -0700 Subject: [PATCH] Skip the numpy doctests. They seem like more trouble that they're worth. --- _pytest/python_api.py | 3 ++- testing/python/approx.py | 3 +-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/_pytest/python_api.py b/_pytest/python_api.py index a2942b742..0c0a6bb74 100644 --- a/_pytest/python_api.py +++ b/_pytest/python_api.py @@ -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 diff --git a/testing/python/approx.py b/testing/python/approx.py index d67500b15..3005a7bbe 100644 --- a/testing/python/approx.py +++ b/testing/python/approx.py @@ -350,11 +350,10 @@ class TestApprox(object): 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, )