Skip to content

Commit 808c872

Browse files
committed
fix testcase for python3.6 with missing dataclasses
1 parent 840be07 commit 808c872

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

tests/test_utils.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
from argparse import ArgumentTypeError
22
from collections import OrderedDict
3-
from dataclasses import dataclass
43
import json
54
import os
65
import subprocess
@@ -138,6 +137,10 @@ def test_type_to_str(self) -> None:
138137
self.assertEqual(type_to_str(Union[List[int], Dict[float, bool]]), 'Union[List[int], Dict[float, bool]]')
139138

140139

140+
def class_decorator(cls):
141+
return cls
142+
143+
141144
class ClassColumnTests(TestCase):
142145
def test_column_simple(self):
143146
class SimpleColumn:
@@ -169,7 +172,7 @@ def func(self):
169172
self.assertEqual(get_class_column(FuncColumn), 12)
170173

171174
def test_dataclass(self):
172-
@dataclass
175+
@class_decorator
173176
class DataclassColumn:
174177
arg: int = 5
175178
self.assertEqual(get_class_column(DataclassColumn), 12)
@@ -178,7 +181,7 @@ def test_dataclass_method(self):
178181
def wrapper(f):
179182
pass
180183

181-
@dataclass
184+
@class_decorator
182185
class DataclassColumn:
183186
@wrapper
184187
def func(self):
@@ -301,7 +304,7 @@ def f(self):
301304
self.assertEqual(get_class_variables(FunctionsWithDocs), class_variables)
302305

303306
def test_dataclass(self):
304-
@dataclass
307+
@class_decorator
305308
class DataclassColumn:
306309
arg: int = 5
307310
class_variables = OrderedDict()

0 commit comments

Comments
 (0)