Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error with pytest-playwright 0.6 #966

Closed
astrofrog opened this issue Jan 10, 2025 · 1 comment · May be fixed by #1006
Closed

Error with pytest-playwright 0.6 #966

astrofrog opened this issue Jan 10, 2025 · 1 comment · May be fixed by #1006

Comments

@astrofrog
Copy link
Contributor

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?

@iisakkirotko
Copy link
Collaborator

Duplicate of #913. I'm afraid for now the only solution is to pin either pytest-playwright or playwright.

@iisakkirotko iisakkirotko closed this as not planned Won't fix, can't repro, duplicate, stale Jan 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants