-
Notifications
You must be signed in to change notification settings - Fork 0
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
Add TemporaryEnvironment context manager #16
Conversation
This class sets and restores environment variables within the context. I'd like to use this in pyiron_base, but thought it'd be nice here as well.
Coverage summary from CodacySee diff coverage on Codacy
Coverage variation details
Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: Diff coverage details
Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: See your quality gate settings Change summary preferences🚀 Don’t miss a bit, follow what’s new on Codacy. Codacy stopped sending the deprecated coverage status on June 5th, 2024. Learn more |
Pull Request Test Coverage Report for Build 9567860514Details
💛 - Coveralls |
Pull Request Test Coverage Report for Build 9567948767Details
💛 - Coveralls |
Pull Request Test Coverage Report for Build 9567969556Details
💛 - Coveralls |
For the application on executables, I am wondering if it is easier to set the environment variables only to the subprocess: https://docs.python.org/3/library/subprocess.html#popen-constructor - |
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.
I like the plan, raw code looks fine to me, just need to get the surrounding infrastructure working.
Tests generated with AI, it's not my fault if they break!!1!
From the "!!1!" I assume this is a little tongue-in-cheek. I do find it super useful to generate initial tests from GPT, but setting aside your frivolity we do need to actually make sure they are both meaningful and complete. In this case, the AI tests actually failed -- I haven't dug in deeply yet to why, but that's a great indicator they actually found something meaningful! In terms of completeness, I read through and don't see any extra cases that are needed.
The docstring will fail a doctest because it doesn't actually show the output. I'm not sure a priori what formatting will be necessary here, but it should be simple enough for me to add when I start the doctests running -- so if I get that done before you merge here, let's fix it, but otherwise no need to wait on it and the example is already human-ready.
Co-authored-by: Liam Huber <[email protected]>
Pull Request Test Coverage Report for Build 9570213602Details
💛 - Coveralls |
Yeah, I prodded GPT a bit and modified the results, but it was enough to get me over the initial activation barrier. |
Coverage summary from CodacySee diff coverage on Codacy
Coverage variation details
Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: Diff coverage details
Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: See your quality gate settings Change summary preferences🚀 Don’t miss a bit, follow what’s new on Codacy. Codacy stopped sending the deprecated coverage status on June 5th, 2024. Learn more |
Pull Request Test Coverage Report for Build 9570305303Details
💛 - Coveralls |
This class sets and restores environment variables within the context. I'd like to use this in pyiron_base, but thought it'd be nice here as well.
Tests generated with AI, it's not my fault if they break!!1!