Update tests
All checks were successful
All checks were successful
This commit is contained in:
parent
a0914e1369
commit
c7a6bfe979
5 changed files with 212 additions and 0 deletions
|
|
@ -1,7 +1,21 @@
|
|||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
import pytest
|
||||
|
||||
# Ensure repository root is on sys.path so `import enroll` resolves to the local package.
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
if str(ROOT) not in sys.path:
|
||||
sys.path.insert(0, str(ROOT))
|
||||
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
def _disable_cli_root_path_prompt_by_default(monkeypatch):
|
||||
"""Keep CLI tests deterministic when the test runner itself runs as root.
|
||||
|
||||
Individual tests that cover the root PATH guard can override this monkeypatch.
|
||||
"""
|
||||
|
||||
import enroll.cli as cli
|
||||
|
||||
monkeypatch.setattr(cli, "_is_effective_root", lambda: False)
|
||||
|
|
|
|||
Reference in a new issue