Skip to content

Commit 3e2a1dd

Browse files
Move the requires_load_dynamic decorator to the class.
1 parent fc94060 commit 3e2a1dd

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

Lib/test/test_imp.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -658,6 +658,7 @@ def parse(cls, text):
658658
return self
659659

660660

661+
@requires_load_dynamic
661662
class SinglephaseInitTests(unittest.TestCase):
662663

663664
NAME = '_testsinglephase'
@@ -898,7 +899,6 @@ def check_copied(self, loaded, base):
898899
#########################
899900
# the tests
900901

901-
@requires_load_dynamic
902902
def test_cleared_globals(self):
903903
loaded = self.load(self.NAME)
904904
_testsinglephase = loaded.module
@@ -912,7 +912,6 @@ def test_cleared_globals(self):
912912
self.assertEqual(init_after, 0)
913913
self.assertEqual(init_count, -1)
914914

915-
@requires_load_dynamic
916915
def test_variants(self):
917916
# Exercise the most meaningful variants described in Python/import.c.
918917
self.maxDiff = None
@@ -996,7 +995,6 @@ def test_variants(self):
996995
self.assertIs(basic.look_up_self(), basic_lookedup)
997996
self.assertEqual(basic.initialized_count(), expected_init_count)
998997

999-
@requires_load_dynamic
1000998
def test_basic_reloaded(self):
1001999
# m_copy is copied into the existing module object.
10021000
# Global state is not changed.
@@ -1039,7 +1037,6 @@ def test_basic_reloaded(self):
10391037

10401038
self.assertIs(reloaded.snapshot.cached, reloaded.module)
10411039

1042-
@requires_load_dynamic
10431040
def test_with_reinit_reloaded(self):
10441041
# The module's m_init func is run again.
10451042
self.maxDiff = None
@@ -1088,7 +1085,6 @@ def test_with_reinit_reloaded(self):
10881085
# which is shared by all interpreters.
10891086

10901087
@requires_subinterpreters
1091-
@requires_load_dynamic
10921088
def test_basic_multiple_interpreters_main_no_reset(self):
10931089
# without resetting; already loaded in main interpreter
10941090

@@ -1157,7 +1153,6 @@ def test_basic_multiple_interpreters_main_no_reset(self):
11571153
# * module's global state was updated, not reset
11581154

11591155
@requires_subinterpreters
1160-
@requires_load_dynamic
11611156
def test_basic_multiple_interpreters_deleted_no_reset(self):
11621157
# without resetting; already loaded in a deleted interpreter
11631158

0 commit comments

Comments
 (0)