Skip to content

Commit 6353382

Browse files
miss-islingtonserhiy-storchaka
authored andcommitted
bpo-34184: Fix running Lib/test/test_dataclasses.py as a script. (GH-8382) (GH-8421)
(cherry picked from commit 3fe5ccc)
1 parent 96bba04 commit 6353382

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Lib/test/test_dataclasses.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1966,7 +1966,7 @@ def test_no_repr(self):
19661966
@dataclass(repr=False)
19671967
class C:
19681968
x: int
1969-
self.assertIn('test_dataclasses.TestRepr.test_no_repr.<locals>.C object at',
1969+
self.assertIn(f'{__name__}.TestRepr.test_no_repr.<locals>.C object at',
19701970
repr(C(3)))
19711971

19721972
# Test a class with a __repr__ and repr=False.
@@ -2713,10 +2713,10 @@ class C:
27132713
self.assertEqual(C(10).x, 10)
27142714

27152715
def test_classvar_module_level_import(self):
2716-
from . import dataclass_module_1
2717-
from . import dataclass_module_1_str
2718-
from . import dataclass_module_2
2719-
from . import dataclass_module_2_str
2716+
from test import dataclass_module_1
2717+
from test import dataclass_module_1_str
2718+
from test import dataclass_module_2
2719+
from test import dataclass_module_2_str
27202720

27212721
for m in (dataclass_module_1, dataclass_module_1_str,
27222722
dataclass_module_2, dataclass_module_2_str,

0 commit comments

Comments
 (0)