2019-09-07 06:48:15 +00:00
|
|
|
commit 898d66c7eeabddf5d17bb899c8beebe5aad2c4ee
|
|
|
|
|
Author: Oscar Benjamin <oscar.j.benjamin@gmail.com>
|
|
|
|
|
Date: Thu Jan 3 17:15:04 2019 +0000
|
|
|
|
|
|
|
|
|
|
Inline np.allclose to remove dependency on numpy
|
|
|
|
|
|
2019-09-20 09:54:28 +00:00
|
|
|
Index: pytest-doctestplus-0.4.0/pytest_doctestplus/output_checker.py
|
|
|
|
|
===================================================================
|
|
|
|
|
--- pytest-doctestplus-0.4.0.orig/pytest_doctestplus/output_checker.py
|
|
|
|
|
+++ pytest-doctestplus-0.4.0/pytest_doctestplus/output_checker.py
|
|
|
|
|
@@ -6,8 +6,7 @@ normalizations of Python expression outp
|
2019-09-07 06:48:15 +00:00
|
|
|
|
|
|
|
|
import doctest
|
|
|
|
|
import re
|
|
|
|
|
-
|
|
|
|
|
-import numpy as np
|
|
|
|
|
+import math
|
|
|
|
|
|
|
|
|
|
import six
|
|
|
|
|
from six.moves import zip
|
2019-09-20 09:54:28 +00:00
|
|
|
@@ -125,8 +124,10 @@ class OutputChecker(doctest.OutputChecke
|
2019-09-07 06:48:15 +00:00
|
|
|
else:
|
|
|
|
|
nw_.append(nw)
|
|
|
|
|
|
|
|
|
|
- if not np.allclose(float(ng), float(nw), rtol=self.rtol,
|
|
|
|
|
- atol=self.atol, equal_nan=True):
|
|
|
|
|
+ ng = float(ng)
|
|
|
|
|
+ nw = float(nw)
|
|
|
|
|
+ if not (abs(ng - nw) <= self.atol + self.rtol * abs(nw)
|
|
|
|
|
+ or (math.isnan(ng) and math.isnan(nw))):
|
|
|
|
|
return False
|
|
|
|
|
|
|
|
|
|
# replace all floats in the "got" string by those from "wanted".
|
2019-09-20 09:54:28 +00:00
|
|
|
Index: pytest-doctestplus-0.4.0/setup.py
|
|
|
|
|
===================================================================
|
|
|
|
|
--- pytest-doctestplus-0.4.0.orig/setup.py
|
|
|
|
|
+++ pytest-doctestplus-0.4.0/setup.py
|
|
|
|
|
@@ -40,7 +40,7 @@ setup(
|
2019-09-07 06:48:15 +00:00
|
|
|
'Topic :: Utilities',
|
|
|
|
|
],
|
2019-09-20 09:54:28 +00:00
|
|
|
keywords=['doctest', 'rst', 'pytest', 'py.test'],
|
|
|
|
|
- install_requires=['six', 'pytest>=3.0', 'numpy>=1.10'],
|
|
|
|
|
+ install_requires=['six', 'pytest>=3.0'],
|
2019-09-07 06:48:15 +00:00
|
|
|
python_requires='>=2.7',
|
|
|
|
|
entry_points={
|
|
|
|
|
'pytest11': [
|