Add tests for dataclasses (#4967)

* Add tests for dataclasses
This closes #4963 and is based on the fix in PyCQA/astroid#1165
2 files changed