forked from HyperionGray/python-chrome-devtools-protocol
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathenv_quick_check.py
More file actions
57 lines (46 loc) · 1.39 KB
/
env_quick_check.py
File metadata and controls
57 lines (46 loc) · 1.39 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
#!/usr/bin/env python3
import sys
import os
import subprocess
print("=== Quick Environment Check ===")
# Basic Python info
print(f"Python: {sys.version}")
print(f"Working directory: {os.getcwd()}")
# Check if we're in the right place
os.chdir('/workspace')
print(f"Workspace files: {sorted(os.listdir('.'))[:10]}")
# Test basic import
print("\n=== Basic Import Test ===")
try:
import cdp
print("✓ CDP imports successfully")
print(f"CDP file: {cdp.__file__}")
# Test a specific module
import cdp.runtime
print("✓ CDP.runtime imports successfully")
except Exception as e:
print(f"✗ CDP import failed: {e}")
# Check for pytest
print("\n=== Tool Check ===")
try:
import pytest
print(f"✓ pytest available: {pytest.__version__}")
except ImportError:
print("✗ pytest not available")
try:
import mypy
print(f"✓ mypy available")
except ImportError:
print("✗ mypy not available")
# Test a simple command
print("\n=== Simple Command Test ===")
try:
result = subprocess.run(['python3', '-c', 'print("Hello from subprocess")'],
capture_output=True, text=True, timeout=5)
if result.returncode == 0:
print("✓ Subprocess execution works")
else:
print("✗ Subprocess execution failed")
except Exception as e:
print(f"✗ Subprocess test failed: {e}")
print("\n=== Ready to test PF tasks ===")