Skip to content

Commit

Permalink
fixup for test
Browse files Browse the repository at this point in the history
  • Loading branch information
sambhavnoobcoder committed Jan 23, 2025
1 parent 729939b commit 689b39f
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions tests/utils/test_import_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,7 @@ def test_clear_import_cache():
# Import some transformers modules

# Get initial module count
initial_modules = {
name: mod for name, mod in sys.modules.items()
if name.startswith('transformers.')
}
initial_modules = {name: mod for name, mod in sys.modules.items() if name.startswith("transformers.")}

# Verify we have some modules loaded
assert len(initial_modules) > 0
Expand All @@ -19,11 +16,8 @@ def test_clear_import_cache():
clear_import_cache()

# Check modules were removed
remaining_modules = {
name: mod for name, mod in sys.modules.items()
if name.startswith('transformers.')
}
remaining_modules = {name: mod for name, mod in sys.modules.items() if name.startswith("transformers.")}
assert len(remaining_modules) < len(initial_modules)

# Verify we can reimport
assert 'transformers.models.auto.modeling_auto' in sys.modules
assert "transformers.models.auto.modeling_auto" in sys.modules

0 comments on commit 689b39f

Please sign in to comment.