Skip to content

Error with pytest-playwright 0.6 #966

@astrofrog

Description

@astrofrog

Minimal reproducer:

python -m venv clean
source clean/bin/activate
pip install solara[pytest]

then create test.py with:

def test_basic(page_session):
    pass

And run the tests with:

pytest test.py

this fails with:

    @pytest.fixture(scope="session")
    def context_session(
        browser: "playwright.sync_api.Browser",
        browser_context_args: Dict,
        pytestconfig: Any,
        request: pytest.FixtureRequest,
    ) -> Generator["playwright.sync_api.BrowserContext", None, None]:
        from playwright.sync_api import Error, Page
>       from pytest_playwright.pytest_playwright import _build_artifact_test_folder
E       ImportError: cannot import name '_build_artifact_test_folder' from 'pytest_playwright.pytest_playwright' (/home/tom/tmp/debug/clean/lib/python3.11/site-packages/pytest_playwright/pytest_playwright.py)

clean/lib/python3.11/site-packages/solara/test/pytest_plugin.py:66: ImportError

Downgrading to pytest-playwright 0.5 fixes this. It looks like some private API was removed?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions