fix: correct pytest_runtest_call hook parameter in conftest.py
- Change invalid 'puretest' parameter to proper pytest hooks - Replace problematic pytest_runtest_call with pytest_runtest_setup/teardown - This fixes PluginValidationError preventing pytest from starting - Remove unused time import 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -6,7 +6,6 @@ import os
|
|||||||
import signal
|
import signal
|
||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
import time
|
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
@@ -107,19 +106,16 @@ def ci_process_monitor():
|
|||||||
stop_monitor.set()
|
stop_monitor.set()
|
||||||
|
|
||||||
|
|
||||||
def pytest_runtest_call(puretest):
|
def pytest_runtest_setup(item):
|
||||||
"""Hook to wrap each test with additional monitoring."""
|
"""Hook called before each test runs."""
|
||||||
if os.environ.get("CI") != "true":
|
if os.environ.get("CI") == "true":
|
||||||
return
|
print(f"\n🚀 [TEST] Starting: {item.nodeid}")
|
||||||
|
|
||||||
print(f"\n🚀 [TEST] Starting: {puretest.nodeid}")
|
|
||||||
start_time = time.time()
|
|
||||||
|
|
||||||
try:
|
def pytest_runtest_teardown(item, nextitem):
|
||||||
yield
|
"""Hook called after each test runs."""
|
||||||
finally:
|
if os.environ.get("CI") == "true":
|
||||||
elapsed = time.time() - start_time
|
print(f"✅ [TEST] Completed: {item.nodeid}")
|
||||||
print(f"✅ [TEST] Completed: {puretest.nodeid} in {elapsed:.1f}s")
|
|
||||||
|
|
||||||
|
|
||||||
def pytest_collection_modifyitems(config, items):
|
def pytest_collection_modifyitems(config, items):
|
||||||
|
|||||||
Reference in New Issue
Block a user