The core 66.76.0 removes constants.BINARY_ENTRY_REL; tests/conftest.py imported it (inside a try that hid the error), so every fixture that needs the package failed at setup in the core's wrapper-on-this-core job. seal.DEFAULT_ENTRY_REL is the table it was a copy of, and exists in both cores. The new test reads every Python file of src, tests, scripts, ci and examples and fails on an import or an access of BINARY_ENTRY_REL, tz_env, BROKEN_VERSIONS, cache_dir_for_version, resolve_session_timezone, _pin, _parse_checksums, or the two database helpers of invisible_core.download. It has its own known-bad cases. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
31 lines
1.1 KiB
Python
31 lines
1.1 KiB
Python
"""A fixture that needs the package says why it cannot have it.
|
|
|
|
⛔ THE KNOWN-BAD INPUT, measured 2026-10-25: with a core whose version the
|
|
wrapper's pin did not name, `invisible_playwright` was not importable, the
|
|
conftest kept `DEFAULT_ENTRY_REL = None`, and `firefox_binary` answered
|
|
|
|
TypeError: argument of type 'NoneType' is not iterable
|
|
|
|
which names neither the pin nor the import. `_require_package()` existed for
|
|
exactly this and two fixtures did not call it.
|
|
"""
|
|
from __future__ import annotations
|
|
|
|
import pytest
|
|
|
|
import conftest
|
|
|
|
pytestmark = pytest.mark.unit
|
|
|
|
|
|
@pytest.mark.parametrize("fixture", ["firefox_binary", "sample_profile"])
|
|
def test_the_fixture_names_the_import_error(monkeypatch, fixture):
|
|
monkeypatch.delenv("INVPW_BINARY_PATH", raising=False)
|
|
monkeypatch.setattr(conftest, "_IMPORT_ERROR",
|
|
ImportError("the pin names a core that is not installed"))
|
|
monkeypatch.setattr(conftest, "DEFAULT_ENTRY_REL", None)
|
|
monkeypatch.setattr(conftest, "generate_profile", None)
|
|
body = getattr(conftest, fixture).__wrapped__
|
|
with pytest.raises(pytest.UsageError, match="the pin names a core"):
|
|
body()
|