File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change 16
16
17
17
import astroid
18
18
from astroid import manager , test_utils
19
- from astroid .const import IS_JYTHON , IS_PYPY
19
+ from astroid .const import IS_JYTHON , IS_PYPY , PY312_PLUS
20
20
from astroid .exceptions import (
21
21
AstroidBuildingError ,
22
22
AstroidImportError ,
@@ -391,13 +391,18 @@ def test_denied_modules_raise(self) -> None:
391
391
392
392
393
393
class IsolatedAstroidManagerTest (unittest .TestCase ):
394
+ @pytest .mark .skipif (PY312_PLUS , reason = "distutils was removed in python 3.12" )
394
395
def test_no_user_warning (self ):
396
+ """When Python 3.12 is minimum, this test will no longer provide value."""
395
397
mgr = manager .AstroidManager ()
396
398
self .addCleanup (mgr .clear_cache )
397
399
with warnings .catch_warnings ():
398
400
warnings .filterwarnings ("error" , category = UserWarning )
399
401
mgr .ast_from_module_name ("setuptools" )
400
- mgr .ast_from_module_name ("pip" )
402
+ try :
403
+ mgr .ast_from_module_name ("pip" )
404
+ except astroid .AstroidImportError :
405
+ pytest .skip ("pip is not installed" )
401
406
402
407
403
408
class BorgAstroidManagerTC (unittest .TestCase ):
You can’t perform that action at this time.
0 commit comments