-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_minimal_list.py
More file actions
59 lines (52 loc) · 1.76 KB
/
Copy pathtest_minimal_list.py
File metadata and controls
59 lines (52 loc) · 1.76 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# test_minimal_list.py
"""
Minimal test to isolate the List import issue.
"""
import sys
import os
sys.path.insert(0, os.path.join(os.path.dirname(__file__), 'app'))
def test_minimal_imports():
"""Test minimal imports to isolate the List issue"""
print("Testing basic typing import...")
try:
from typing import List
print("✅ typing.List imported successfully")
except Exception as e:
print(f"❌ typing.List import failed: {e}")
return False
print("Testing tasks.py import...")
try:
from tasks import train_pinsage_model # pyright: ignore[reportMissingImports]
print("✅ train_pinsage_model imported successfully")
except NameError as e:
if "List" in str(e):
print(f"❌ List error in tasks.py: {e}")
return False
else:
print(f"❌ Other error in tasks.py: {e}")
return False
except Exception as e:
print(f"❌ Other error importing tasks.py: {e}")
return False
print("Testing main.py import...")
try:
from main import app # pyright: ignore[reportMissingImports]
print("✅ main.py imported successfully")
except NameError as e:
if "List" in str(e):
print(f"❌ List error in main.py: {e}")
return False
else:
print(f"❌ Other error in main.py: {e}")
return False
except Exception as e:
print(f"❌ Other error importing main.py: {e}")
return False
print("✅ All imports successful!")
return True
if __name__ == "__main__":
success = test_minimal_imports()
if success:
print("\n🎉 No List import errors found!")
else:
print("\n❌ List import errors detected!")