mirror of
https://github.com/instructkr/claw-code.git
synced 2026-11-18 00:00:00 +08:00
test: enforce bash lru_cache clearance and expose specific skip reasons
Adds a conftest.py pytest fixture to explicitly clear the lru_cache for bash detection, addressing the monkeypatching hazard in a way that doesn't rely solely on comments. (Note: CI currently runs python -m unittest, but this keeps local pytest runners safe.) Also updates the bash check to run the execution probe directly inside the cached _check_bash_state, exposing the difference between 'no bash found' and 'bash present but execution failed' directly to the unittest skip reason.
This commit is contained in:
1 parent
c31c5e27dd
commit
86cf10a43a
4 files changed
+40
-23
No files matched your search
@@ -0,0 +1,8 @@
|
||||
import pytest
|
||||
from tests._bash import _check_bash_state
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
def _clear_bash_cache():
|
||||
_check_bash_state.cache_clear()
|
||||
yield
|
||||
_check_bash_state.cache_clear()
|
||||
Reference in new issue
Block a user