diff options
author | Claudiu Popa <pcmanticore@gmail.com> | 2019-11-21 09:45:33 +0100 |
---|---|---|
committer | Claudiu Popa <pcmanticore@gmail.com> | 2019-11-21 09:46:55 +0100 |
commit | e169e83e52fedc6624235d45e8e8737294a0fedf (patch) | |
tree | fda57c39616d9a163e1f9136f09709c686009ce4 /tests/unittest_pyreverse_diadefs.py | |
parent | 3d8e0b39f2c41e50c664847a3397c60ee883efd4 (diff) | |
download | pylint-git-2.4.tar.gz |
Fixed an ``AttributeError`` caused by improper handling of ``dataclasses`` inference in ``pyreverse``2.4
Close #3256
Diffstat (limited to 'tests/unittest_pyreverse_diadefs.py')
-rw-r--r-- | tests/unittest_pyreverse_diadefs.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/unittest_pyreverse_diadefs.py b/tests/unittest_pyreverse_diadefs.py index 0659a5b11..307f22a94 100644 --- a/tests/unittest_pyreverse_diadefs.py +++ b/tests/unittest_pyreverse_diadefs.py @@ -13,6 +13,9 @@ unit test for the extensions.diadefslib modules """ +import sys +from pathlib import Path + import astroid import pytest @@ -173,3 +176,14 @@ def test_known_values2(HANDLER, PROJECT): (True, "DoNothing"), (True, "Specialization"), ] + + +@pytest.mark.skipif(sys.version_info < (3, 8), reason="Requires dataclasses") +def test_regression_dataclasses_inference(HANDLER): + project_path = Path("regrtest_data") / "dataclasses_pyreverse" + path = get_project(str(project_path)) + + cdg = ClassDiadefGenerator(Linker(path), HANDLER) + special = "regrtest_data.dataclasses_pyreverse.InventoryItem" + cd = cdg.class_diagram(path, special) + assert cd.title == special |