File tree Expand file tree Collapse file tree 1 file changed +9
-10
lines changed
Expand file tree Collapse file tree 1 file changed +9
-10
lines changed Original file line number Diff line number Diff line change @@ -435,14 +435,8 @@ def test_dotted_import_collector_skips_star_imports():
435435 module .visit (collector )
436436
437437 # Should collect regular imports but skip the star import
438- expected_imports = {
439- 'pathlib.Path' ,
440- 'collections.defaultdict' ,
441- 'os'
442- }
438+ expected_imports = {'collections.defaultdict' , 'os' , 'pathlib.Path' }
443439 assert collector .imports == expected_imports
444- # Ensure the star import from typing is not collected
445- assert not any ('typing' in imp for imp in collector .imports )
446440
447441
448442def test_add_needed_imports_with_star_import_resolution ():
@@ -489,6 +483,11 @@ def my_function():
489483 )
490484
491485 # The result should have individual imports instead of star import
492- assert 'from source_module import' in result
493- assert 'HelperClass' in result and 'UtilFunction' in result
494- assert 'from source_module import *' not in result
486+ expected_result = '''from source_module import HelperClass, UtilFunction
487+
488+ def my_function():
489+ helper = HelperClass()
490+ UtilFunction()
491+ return helper
492+ '''
493+ assert result == expected_result
You can’t perform that action at this time.
0 commit comments