test: add pytest markers, conftest, fix Windows-incompatible existing tests
- Add tests/conftest.py with deterministic_rng + sample_profile fixtures - Register unit/integration/e2e markers in pyproject.toml - Mark existing 14 tests as @pytest.mark.unit - Fix test_cli.py: use 'invisible_playwright' (underscore) for 'python -m' - Fix test_translate_includes_gpu_renderer: assert Windows behavior (empty renderer)
This commit is contained in:
+7
-3
@@ -1,19 +1,23 @@
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
import pytest
|
||||
|
||||
|
||||
@pytest.mark.unit
|
||||
def test_version_subcommand():
|
||||
r = subprocess.run(
|
||||
[sys.executable, "-m", "invisible-playwright", "version"],
|
||||
[sys.executable, "-m", "invisible_playwright", "version"],
|
||||
capture_output=True, text=True, check=True,
|
||||
)
|
||||
assert "firefox-" in r.stdout
|
||||
assert "invisible-playwright" in r.stdout.lower()
|
||||
assert "invisible_playwright" in r.stdout.lower()
|
||||
|
||||
|
||||
@pytest.mark.unit
|
||||
def test_help_subcommand():
|
||||
r = subprocess.run(
|
||||
[sys.executable, "-m", "invisible-playwright", "--help"],
|
||||
[sys.executable, "-m", "invisible_playwright", "--help"],
|
||||
capture_output=True, text=True,
|
||||
)
|
||||
assert r.returncode == 0
|
||||
|
||||
Reference in New Issue
Block a user