-
-
Notifications
You must be signed in to change notification settings - Fork 14
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
ENH Add rename_fixture and standalone decorators #101
Conversation
We use a bunch of different selenium variants but for the most part they are drop-in replacements for each other. For instance, when using `selenium_standalone`, we always just say `selenium = selenium_standalone` at the top of the function. I think it's clearer if we use a decorator to rename the fixture.
Thanks @hoomane! We have some logic for modifying the test order when standalone fixtures are used in the Safari browser. Could you check if it works well with pytest-pyodide/pytest_pyodide/hook.py Lines 193 to 212 in 05f95eb
BTW, we have both |
Sure. It should work fine with everything since the rename happens right away in the decorator nothing has the opportunity to see the original function, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the check!
There are some CI failures, but I think those are not relevant to this PR (some are about hypothesis, and some are about playwright)...
This fixes a test failure that started to occur after #101. ``` ! _pytest.outcomes.Exit: playwright failed to launch ``` The cause of the problem was that the combination of the `pytester` fixture and the `pytest_configure` hook is not very good. We use `pytest_configure` to manage global settings, but this function is called again when we run sub-tests using pytester, resulting in new global settings being overwritten. So I added a check to prevent overwriting global settings once it is set.
We use a bunch of different selenium variants but for the most part they are drop-in replacements for each other. For instance, when using
selenium_standalone
, we always just sayselenium = selenium_standalone
at the top of the function. I think it's clearer if we use a decorator to rename the fixture.