Skip to content

Commit d77a0f2

Browse files
committed
fix: resolve F824 flake8 errors - remove unnecessary global declarations
Removed unused `global _scrapetui_module` declarations from three test files. These global statements were flagged by flake8 F824 because the variable itself was never reassigned in scope - only its attributes were modified. In Python, you don't need `global` to modify attributes of a module-level object; it's only needed when reassigning the variable itself. Files fixed: - tests/test_analytics.py:38 - tests/test_performance.py:55 - tests/test_scheduling.py:39 Verification: - flake8 critical errors (E9,F63,F7,F82): 0 ✅ - pytest test suite: 307/307 passing (100%) ✅ - No test functionality affected Resolves GitHub Actions workflow failures in runs: - #18236485813 (2025-10-04) - #18236145310 (2025-10-03) - #18235535859 (2025-10-03)
1 parent 504e226 commit d77a0f2

File tree

3 files changed

+0
-3
lines changed

3 files changed

+0
-3
lines changed

tests/test_analytics.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ def analytics_test_db(temp_db):
3535
"""Create a temporary database for analytics testing with unique data."""
3636
# temp_db fixture from conftest.py already provides isolated database
3737
# IMPORTANT: Must patch the monolithic module's DB_PATH to use temp database
38-
global _scrapetui_module
3938
_scrapetui_module.DB_PATH = temp_db
4039

4140
# Just add test data to it

tests/test_performance.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ def perf_test_db(tmp_path):
5252
db_path = tmp_path / "perf_test.db"
5353

5454
# Patch the monolithic module's DB_PATH to use temp database
55-
global _scrapetui_module
5655
original_db = _scrapetui_module.DB_PATH
5756
_scrapetui_module.DB_PATH = Path(db_path)
5857

tests/test_scheduling.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ def temp_db(monkeypatch):
3636
temp_db_path = f.name
3737

3838
# Patch the monolithic module's DB_PATH to use temp database
39-
global _scrapetui_module
4039
original_db = _scrapetui_module.DB_PATH
4140
_scrapetui_module.DB_PATH = Path(temp_db_path)
4241

0 commit comments

Comments
 (0)