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

Only parse configuration once per session #247

Merged

Conversation

rnestler
Copy link
Contributor

@rnestler rnestler commented Apr 5, 2022

To avoid having to re-read the configuration for every single test we
put it into a "session" fixture. To still have a fresh copy of the
configuration for every test (in case a test modifies it) we wrap it in
a "function" fixture which makes a deepcopy of it.

@rnestler
Copy link
Contributor Author

rnestler commented Apr 6, 2022

General questions, why is conftest.py duplicated in the repo? Can we just symlink on to the other (or will this break stuff on Windows)?

@ElSnoMan
Copy link
Owner

ElSnoMan commented Apr 6, 2022

General questions, why is conftest.py duplicated in the repo? Can we just symlink on to the other (or will this break stuff on Windows)?

This was done at the very beginning of the project when there was a conftest.py specific to the repo and a conftest.py that was meant to be packaged. At first, I was going to use the "plugin" approach so the user wouldn't get a conftest.py file at all (while still having all our fixtures like py), but there were so many different use-cases people had that I hadn't thought of. It was easier to give them the conftest.py file to start so they could edit/extend as needed.

However, now the pylenium.json and conftest.py files are the same at the workspace root and in the scripts folder, so if you know how to remove the duplication, I'm very open to doing so!

@ElSnoMan ElSnoMan added the enhancement New feature or request label Apr 6, 2022
To avoid having to re-read the configuration for every single test we
put it into a "session" fixture. To still have a fresh copy of the
configuration for every test (in case a test modifies it) we wrap it in
a "function" fixture which makes a deepcopy of it.
@rnestler rnestler force-pushed the only-parse-config-once-per-session branch from e68a3fd to 8b3975d Compare April 7, 2022 07:27
@rnestler rnestler requested a review from ElSnoMan April 7, 2022 08:04
@ElSnoMan ElSnoMan merged commit c9e3972 into ElSnoMan:main Apr 7, 2022
@rnestler rnestler deleted the only-parse-config-once-per-session branch April 8, 2022 06:36
@rnestler rnestler restored the only-parse-config-once-per-session branch April 8, 2022 06:42
@rnestler rnestler deleted the only-parse-config-once-per-session branch April 8, 2022 06:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants