From d3d4d94970fa237d6b84faa645294316cf2f0a45 Mon Sep 17 00:00:00 2001 From: Daniel Pizetta Date: Thu, 1 Feb 2018 17:29:18 -0200 Subject: [PATCH] Add test for fix #4019 --- tests/test_ext_inheritance_diagram.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/test_ext_inheritance_diagram.py b/tests/test_ext_inheritance_diagram.py index deb04ce15..ed79729e6 100644 --- a/tests/test_ext_inheritance_diagram.py +++ b/tests/test_ext_inheritance_diagram.py @@ -83,6 +83,15 @@ def test_import_classes(rootdir): with pytest.raises(InheritanceException): import_classes('unknown.Unknown', None) + # got exception InheritanceException for wrong class or module + # not AttributeError (refs: #4019) + with pytest.raises(InheritanceException): + import_classes('unknown', '.') + with pytest.raises(InheritanceException): + import_classes('unknown.Unknown', '.') + with pytest.raises(InheritanceException): + import_classes('.', None) + # a module having no classes classes = import_classes('sphinx', None) assert classes == []