diff --git a/test/context_test.py b/test/context_test.py index 61e8510..e680a2c 100644 --- a/test/context_test.py +++ b/test/context_test.py @@ -1,5 +1,6 @@ +import sys import unittest -from dataclasses import dataclass +from unittest import skipIf from junkie.context import Context @@ -32,7 +33,10 @@ def __init__(self, prefix, suffix): with context.build(Class) as instance: self.assertEqual("abcxyz", instance.text) + @skipIf(sys.version_info.major <= 3 and sys.version_info.minor < 7, "@dataclass is new in version 3.7") def test_dataclass_decorator(self): + from dataclasses import dataclass + @dataclass class Class: prefix: str