Skip to content

Commit

Permalink
skip test if @DataClass is not available
Browse files Browse the repository at this point in the history
  • Loading branch information
sealor committed Feb 9, 2020
1 parent fd2b82b commit 8b5491d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion test/context_test.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import sys
import unittest
from dataclasses import dataclass
from unittest import skipIf

from junkie.context import Context

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 8b5491d

Please sign in to comment.