scipy-doctest 2.0.0__py3-none-any.whl → 2.1.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
scipy_doctest/__init__.py CHANGED
@@ -3,7 +3,7 @@ Configurable, whitespace-insensitive, floating-point-aware doctest helpers.
3
3
  """
4
4
 
5
5
 
6
- __version__ = "2.0.0"
6
+ __version__ = "2.1.0"
7
7
 
8
8
  try:
9
9
  # register internal modules with pytest; obscure errors galore otherwise
scipy_doctest/impl.py CHANGED
@@ -605,6 +605,17 @@ class DTFinder(doctest.DocTestFinder):
605
605
  verbose, dtverbose = util._map_verbosity(verbose)
606
606
  super().__init__(dtverbose, parser, recurse, exclude_empty)
607
607
 
608
+ def _from_module(self, module, object):
609
+ # https://github.com/pandas-dev/pandas/blob/91514c363604506f447e53380d3aa00520f1037b/pandas/conftest.py#L122-L131
610
+ # We only get here when the class that the method is on is from the
611
+ # appropriate module. So ignore checking the __module__ of the method
612
+ # itself and run the doctest.
613
+ # cf https://mail.python.org/archives/list/numpy-discussion@python.org/thread/PWZUBTNEQ2O2UEGJLU257C5VCT4YTQ5Y/
614
+ # for the discussion
615
+ if inspect.isfunction(object) and "." in object.__qualname__:
616
+ return True
617
+ return super()._from_module(module, object)
618
+
608
619
  def find(self, obj, name=None, module=None, globs=None, extraglobs=None):
609
620
  if globs is None:
610
621
  globs = dict(self.config.default_namespace)
scipy_doctest/util.py CHANGED
@@ -10,7 +10,7 @@ import tempfile
10
10
  import inspect
11
11
  from contextlib import contextmanager
12
12
 
13
- from typing import Sequence
13
+ from typing import Sequence, Union
14
14
 
15
15
  from importlib.metadata import version as get_version, PackageNotFoundError
16
16
  from packaging.requirements import Requirement
@@ -259,7 +259,7 @@ def get_public_objects(module, skiplist=None):
259
259
  return (items, names), failures
260
260
 
261
261
 
262
- def is_req_satisfied(req_strs: str | Sequence[str]) -> bool:
262
+ def is_req_satisfied(req_strs: Union[str, Sequence[str]]) -> bool:
263
263
  """ Check if all PEP 508-compliant requirement(s) are satisfied or not.
264
264
  """
265
265
  req_strs = [req_strs] if isinstance(req_strs, str) else req_strs
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: scipy_doctest
3
- Version: 2.0.0
3
+ Version: 2.1.0
4
4
  Summary: Configurable, whitespace-insensitive, floating-point-aware doctest helpers.
5
5
  Maintainer-email: SciPy developers <scipy-dev@python.org>
6
6
  Requires-Python: >=3.8
@@ -1,10 +1,10 @@
1
- scipy_doctest/__init__.py,sha256=W0Mu3q_cXwIGUV0ldMQwEqXf0SDky5fY22sS0Zr0Yno,650
1
+ scipy_doctest/__init__.py,sha256=K-kx-AqMjLtrWWT0phqW0v-os31jahehpE7q_LhFhB8,650
2
2
  scipy_doctest/__main__.py,sha256=H8jTO13GlOLzexbgu7lHMJW1y3_NhLOSArARFZ5WS7o,90
3
3
  scipy_doctest/conftest.py,sha256=rOkdrpmq95vzvMGMqm88c4HTrbpxLOvANtEuiD6suCg,52
4
4
  scipy_doctest/frontend.py,sha256=wl0-8I6epZ49TwxKVSuZbizS6J_pxea99z0vAv2EdbY,19126
5
- scipy_doctest/impl.py,sha256=dmZBlfq-WbZdCCV6qOO-PjG0adT26XpMdd5lhE_AZzU,27849
5
+ scipy_doctest/impl.py,sha256=5WAkvDK5K3JERmxHW18RVPmYZ-W3AxxtOhLiGXHz4tI,28504
6
6
  scipy_doctest/plugin.py,sha256=X-XtZKu3Mh6iXLGqF6gsIv46H7YTDlOtMncQ-0pRPxs,14420
7
- scipy_doctest/util.py,sha256=8-to4UpZt_ESoJq8kCWAPDMUGBh19GOxv2DZnMvNKWY,8769
7
+ scipy_doctest/util.py,sha256=1JP-wqkZgYFoD924KNaKAxUuwo39KkP1yFafy4aAhVM,8782
8
8
  scipy_doctest/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
9
9
  scipy_doctest/tests/failure_cases.py,sha256=P63datnbqpB5iUpdiTezZ1wOjjU-zbEDt7PVeTQ68JU,1934
10
10
  scipy_doctest/tests/failure_cases_2.py,sha256=p2Qg_eKh35-gavFS25hRNkYW22w8kwNRlAg0Vrq4MtM,783
@@ -23,8 +23,8 @@ scipy_doctest/tests/test_runner.py,sha256=cXDY51lRP7fG-5C_6Y69e8fFsB6mLr0NWauH4s
23
23
  scipy_doctest/tests/test_skipmarkers.py,sha256=dLcoy1F0e1GrLLAi2CqJQLapFB8uUBoqkTT-n5oFWbY,8182
24
24
  scipy_doctest/tests/test_testfile.py,sha256=66ZHUpEGGg8MfQT8EKSZ8Zx5pV55gP__TZejGMYwBHA,733
25
25
  scipy_doctest/tests/test_testmod.py,sha256=UW_UCSW-7cu4Hw3kLVS6Hg9c9xq5hN-QbLa6wCaoWMY,6817
26
- scipy_doctest-2.0.0.dist-info/entry_points.txt,sha256=dFda3z6PjFL7pEWokv_QmoLwE8X1HETCY1H60xopQ-s,47
27
- scipy_doctest-2.0.0.dist-info/licenses/LICENSE,sha256=xH5PVX8bm8e1JxkmJ-e5FsZsOa7FsNOMfepmCvMoR9g,1523
28
- scipy_doctest-2.0.0.dist-info/WHEEL,sha256=G2gURzTEtmeR8nrdXUJfNiB3VYVxigPQ-bEQujpNiNs,82
29
- scipy_doctest-2.0.0.dist-info/METADATA,sha256=n796XWg8_kme5IEJ4yaWLufGtkwdFW0iCAdOVWLbYGA,17501
30
- scipy_doctest-2.0.0.dist-info/RECORD,,
26
+ scipy_doctest-2.1.0.dist-info/entry_points.txt,sha256=dFda3z6PjFL7pEWokv_QmoLwE8X1HETCY1H60xopQ-s,47
27
+ scipy_doctest-2.1.0.dist-info/licenses/LICENSE,sha256=xH5PVX8bm8e1JxkmJ-e5FsZsOa7FsNOMfepmCvMoR9g,1523
28
+ scipy_doctest-2.1.0.dist-info/WHEEL,sha256=G2gURzTEtmeR8nrdXUJfNiB3VYVxigPQ-bEQujpNiNs,82
29
+ scipy_doctest-2.1.0.dist-info/METADATA,sha256=X14a7sfWA85UHI4_N7h46Y-kOUXPl6p9gX_Apo6fij0,17501
30
+ scipy_doctest-2.1.0.dist-info/RECORD,,