Account for Python 3.7 in the 7.4.x branch
This commit is contained in:
parent
3dc0657347
commit
189fcb7ac6
|
@ -545,7 +545,9 @@ class DoctestModule(Module):
|
|||
Here we override `_from_module` to check the underlying
|
||||
function instead. https://github.com/python/cpython/issues/107995
|
||||
"""
|
||||
if isinstance(object, functools.cached_property):
|
||||
if hasattr(functools, "cached_property") and isinstance(
|
||||
object, functools.cached_property
|
||||
):
|
||||
object = object.func
|
||||
|
||||
# Type ignored because this is a private function.
|
||||
|
|
|
@ -482,6 +482,9 @@ class TestDoctests:
|
|||
reprec = pytester.inline_run(p, "--doctest-modules")
|
||||
reprec.assertoutcome(failed=1)
|
||||
|
||||
@pytest.mark.skipif(
|
||||
sys.version_info[:2] <= (3, 7), reason="Only Python 3.7 or less"
|
||||
)
|
||||
def test_doctest_cached_property(self, pytester: Pytester):
|
||||
p = pytester.makepyfile(
|
||||
"""
|
||||
|
|
Loading…
Reference in New Issue