Skip to content

Commit

Permalink
fix style changes
Browse files Browse the repository at this point in the history
  • Loading branch information
sambhavnoobcoder committed Jan 23, 2025
1 parent 33b7091 commit 3b4836c
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions tests/utils/test_import_utils.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import sys
import pytest
from transformers.utils.import_utils import clear_import_cache, _LazyModule

from transformers.utils.import_utils import clear_import_cache

def test_clear_import_cache():
# Import some transformers modules
from transformers import AutoModel, AutoTokenizer

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

Expand All @@ -20,11 +20,11 @@ def test_clear_import_cache():

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

# Verify we can reimport
from transformers import AutoModel, AutoTokenizer
assert 'transformers.models.auto.modeling_auto' in sys.modules
assert 'transformers.models.auto.modeling_auto' in sys.modules

0 comments on commit 3b4836c

Please sign in to comment.