diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2018-07-23 20:37:55 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-23 20:37:55 (GMT) |
commit | 3fe5cccb08283f5f4817ac432560972a4c0f5290 (patch) | |
tree | 7478714e968b05d790d1ce2a2159df6c0e9493e9 /Lib | |
parent | 147d95511f59cfdd2d522f9d736f2335457bae20 (diff) | |
download | cpython-3fe5cccb08283f5f4817ac432560972a4c0f5290.zip cpython-3fe5cccb08283f5f4817ac432560972a4c0f5290.tar.gz cpython-3fe5cccb08283f5f4817ac432560972a4c0f5290.tar.bz2 |
bpo-34184: Fix running Lib/test/test_dataclasses.py as a script. (GH-8382)
Diffstat (limited to 'Lib')
-rwxr-xr-x | Lib/test/test_dataclasses.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Lib/test/test_dataclasses.py b/Lib/test/test_dataclasses.py index d9556c7..c5140e8 100755 --- a/Lib/test/test_dataclasses.py +++ b/Lib/test/test_dataclasses.py @@ -1966,7 +1966,7 @@ class TestRepr(unittest.TestCase): @dataclass(repr=False) class C: x: int - self.assertIn('test_dataclasses.TestRepr.test_no_repr.<locals>.C object at', + self.assertIn(f'{__name__}.TestRepr.test_no_repr.<locals>.C object at', repr(C(3))) # Test a class with a __repr__ and repr=False. @@ -2713,10 +2713,10 @@ class TestStringAnnotations(unittest.TestCase): self.assertEqual(C(10).x, 10) def test_classvar_module_level_import(self): - from . import dataclass_module_1 - from . import dataclass_module_1_str - from . import dataclass_module_2 - from . import dataclass_module_2_str + from test import dataclass_module_1 + from test import dataclass_module_1_str + from test import dataclass_module_2 + from test import dataclass_module_2_str for m in (dataclass_module_1, dataclass_module_1_str, dataclass_module_2, dataclass_module_2_str, |