23
23
AttributeInferenceError ,
24
24
)
25
25
from astroid .interpreter ._import import util
26
- from astroid .interpreter ._import .spec import clear_spec_cache
27
26
from astroid .modutils import EXT_LIB_DIRS , module_in_path
28
27
from astroid .nodes import Const
29
28
from astroid .nodes .scoped_nodes import ClassDef , Module
@@ -37,13 +36,11 @@ def _get_file_from_object(obj) -> str:
37
36
return obj .__file__
38
37
39
38
40
- class AstroidManagerTest (
41
- resources .SysPathSetup , resources .AstroidCacheSetupMixin , unittest .TestCase
42
- ):
39
+ class AstroidManagerTest (resources .SysPathSetup , unittest .TestCase ):
43
40
def setUp (self ) -> None :
44
41
super ().setUp ()
45
- clear_spec_cache ()
46
42
self .manager = test_utils .brainless_manager ()
43
+ self .manager .clear_cache ()
47
44
48
45
def test_ast_from_file (self ) -> None :
49
46
filepath = unittest .__file__
@@ -393,9 +390,10 @@ def test_denied_modules_raise(self) -> None:
393
390
self .manager .ast_from_module_name ("math" )
394
391
395
392
396
- class IsolatedAstroidManagerTest (resources . AstroidCacheSetupMixin , unittest .TestCase ):
393
+ class IsolatedAstroidManagerTest (unittest .TestCase ):
397
394
def test_no_user_warning (self ):
398
395
mgr = manager .AstroidManager ()
396
+ self .addCleanup (mgr .clear_cache )
399
397
with warnings .catch_warnings ():
400
398
warnings .filterwarnings ("error" , category = UserWarning )
401
399
mgr .ast_from_module_name ("setuptools" )
0 commit comments