@@ -537,17 +537,19 @@ def _find(
537
537
tests , obj , name , module , source_lines , globs , seen
538
538
)
539
539
540
- def _from_module (self , module , object ):
541
- """`cached_property` objects will are never considered a part
542
- of the 'current module'. As such they are skipped by doctest.
543
- Here we override `_from_module` to check the underlying
544
- function instead. https://github.com/python/cpython/issues/107995
545
- """
546
- if isinstance (object , functools .cached_property ):
547
- object = object .func
540
+ if sys .version_info < (3 , 13 ):
548
541
549
- # Type ignored because this is a private function.
550
- return super ()._from_module (module , object ) # type: ignore[misc]
542
+ def _from_module (self , module , object ):
543
+ """`cached_property` objects are never considered a part
544
+ of the 'current module'. As such they are skipped by doctest.
545
+ Here we override `_from_module` to check the underlying
546
+ function instead. https://github.com/python/cpython/issues/107995
547
+ """
548
+ if isinstance (object , functools .cached_property ):
549
+ object = object .func
550
+
551
+ # Type ignored because this is a private function.
552
+ return super ()._from_module (module , object ) # type: ignore[misc]
551
553
552
554
if self .path .name == "conftest.py" :
553
555
module = self .config .pluginmanager ._importconftest (
0 commit comments