@@ -460,7 +460,7 @@ class Data:
460
460
)
461
461
462
462
module = import_path (fn , mode = "importlib" , root = tmp_path )
463
- Data : Any = module . Data # type: ignore[attr-defined]
463
+ Data : Any = getattr ( module , "Data" )
464
464
data = Data (value = "foo" )
465
465
assert data .value == "foo"
466
466
assert data .__module__ == "src.tests.test_dataclass"
@@ -486,7 +486,8 @@ def round_trip():
486
486
)
487
487
488
488
module = import_path (fn , mode = "importlib" , root = tmp_path )
489
- action : Any = module .round_trip () # type: ignore[attr-defined]
489
+ round_trip = getattr (module , "round_trip" )
490
+ action = round_trip ()
490
491
assert action () == 42
491
492
492
493
@@ -532,10 +533,10 @@ def round_trip(obj):
532
533
return pickle .loads (s )
533
534
534
535
module = import_path (fn1 , mode = "importlib" , root = tmp_path )
535
- Data1 = module . Data # type: ignore[attr-defined]
536
+ Data1 = getattr ( module , "Data" )
536
537
537
538
module = import_path (fn2 , mode = "importlib" , root = tmp_path )
538
- Data2 = module . Data # type: ignore[attr-defined]
539
+ Data2 = getattr ( module , "Data" )
539
540
540
541
assert round_trip (Data1 (20 )) == Data1 (20 )
541
542
assert round_trip (Data2 ("hello" )) == Data2 ("hello" )
0 commit comments