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

Fix auto screenshots for session browser with latest pytest #157

Conversation

SunilMohanAdapa
Copy link
Contributor

_fixture_values and _funcargs properties, the internal API for FixtureRequest
object, are no longer available in latest versions of pytest. It appears
fixturenames property and getfixturevalue() method can be used for the purpose
of retrieving all session_browser fixture instances. According to changelog,
both are available on pytest 3.0.0 and up.

Signed-off-by: Sunil Mohan Adapa sunil@medhas.org

_fixture_values and _funcargs properties, the internal API for FixtureRequest
object, are no longer available in latest versions of pytest. It appears
fixturenames property and getfixturevalue() method can be used for the purpose
of retrieving all session_browser fixture instances. According to changelog,
both are available on pytest 3.0.0 and up.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
@SunilMohanAdapa
Copy link
Contributor Author

I ran into a trouble with getfixturevalues() so I am instead using:

        fixture_def = request._fixture_defs.get(name)
        if not fixture_def or not fixture_def.cached_result:
            continue

        value = fixture_def.cached_result[0]

jvalleroy pushed a commit to freedombox/FreedomBox that referenced this pull request Jan 22, 2022
pytest_splinter has an issue with creating screenshots when using
session_browser instead of a browser fixture. Implement a workaround.

See: pytest-dev/pytest-splinter#157

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
@mpasternak mpasternak merged commit 6c741be into pytest-dev:master Aug 7, 2022
mpasternak added a commit that referenced this pull request Aug 7, 2022
…ser-screenshots"

This reverts commit 6c741be, reversing
changes made to 2446326.
@mpasternak
Copy link
Contributor

Hi. I reverted this, because this does not work with the recent CI - at all.

Also, I understand this was a problem with pytest 5. We're now on pytest 7 and there seems to be no problem. In case you disagree, please re-submit this PR with the recent codebase. Thanks.

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 this pull request may close these issues.

2 participants