@@ -1822,24 +1822,6 @@ def __init__(self, test, modules):
1822
1822
1823
1823
def find_spec (self , fullname , path , target = None ):
1824
1824
if fullname in self .modules :
1825
- current = eventlet .getcurrent ()
1826
- # NOTE(gibi) not all eventlet spawn is under our control, so
1827
- # there can be senders without test_case_id set, find the first
1828
- # ancestor that was spawned from nova.utils.spawn[_n] and
1829
- # therefore has the id set.
1830
- while (
1831
- current is not None and
1832
- not getattr (current , 'test_case_id' , None )
1833
- ):
1834
- current = current .parent
1835
-
1836
- if current is not None :
1837
- self .test .tc_id = current .test_case_id
1838
- LOG .warning (
1839
- "!!!---!!! TestCase ID %s hit the import poison while "
1840
- "importing %s. If you see this in a failed functional "
1841
- "test then please let #openstack-nova on IRC know "
1842
- "about it. !!!---!!!" , current .test_case_id , fullname )
1843
1825
self .test .fail_message = (
1844
1826
f"This test imports the '{ fullname } ' module, which it "
1845
1827
f'should not in the test environment. Please add '
@@ -1850,7 +1832,6 @@ def find_spec(self, fullname, path, target=None):
1850
1832
def __init__ (self , module_names ):
1851
1833
self .module_names = module_names
1852
1834
self .fail_message = ''
1853
- self .tc_id = None
1854
1835
if isinstance (module_names , str ):
1855
1836
self .module_names = {module_names }
1856
1837
self .meta_path_finder = self .ForbiddenModules (self , self .module_names )
@@ -1868,13 +1849,6 @@ def cleanup(self):
1868
1849
# there (which is also what self.assert* and self.fail() do underneath)
1869
1850
# will not work to cause a failure in the test.
1870
1851
if self .fail_message :
1871
- if self .tc_id is not None :
1872
- LOG .warning (
1873
- "!!!---!!! TestCase ID %s hit the import poison. If you "
1874
- "see this in a failed functional test then please let "
1875
- "#openstack-nova on IRC know about it. !!!---!!!" ,
1876
- self .tc_id
1877
- )
1878
1852
raise ImportError (self .fail_message )
1879
1853
1880
1854
0 commit comments