diff options
author | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2019-02-03 17:07:13 +0900 |
---|---|---|
committer | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2019-02-03 17:07:13 +0900 |
commit | aabbbe346cb09668f7431edec79d6c10b47d988d (patch) | |
tree | cf06376b79fd1844ebe6071b2164b4a8f626d7fe /tests/test_ext_autodoc_importer.py | |
parent | 98863e961a714d7eb41b808fb73125b34d10acdd (diff) | |
parent | 6b3244d679cfe3994ac941c2673195e5415757ab (diff) | |
download | sphinx-git-aabbbe346cb09668f7431edec79d6c10b47d988d.tar.gz |
Merge branch '1.8'
Diffstat (limited to 'tests/test_ext_autodoc_importer.py')
-rw-r--r-- | tests/test_ext_autodoc_importer.py | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/test_ext_autodoc_importer.py b/tests/test_ext_autodoc_importer.py index 03a597ee0..ea40632ef 100644 --- a/tests/test_ext_autodoc_importer.py +++ b/tests/test_ext_autodoc_importer.py @@ -8,6 +8,7 @@ :license: BSD, see LICENSE for details. """ +import abc import sys import pytest @@ -60,3 +61,21 @@ def test_mock_does_not_follow_upper_modules(): with mock(['sphinx.unknown.module']): with pytest.raises(ImportError): __import__('sphinx.unknown') + + +@pytest.mark.skipif(sys.version_info < (3, 7), reason='Only for py37 or above') +def test_abc_MockObject(): + mock = _MockObject() + + class Base: + @abc.abstractmethod + def __init__(self): + pass + + class Derived(Base, mock.SubClass): + pass + + obj = Derived() + assert isinstance(obj, Base) + assert isinstance(obj, _MockObject) + assert isinstance(obj.some_method(), Derived) |