Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Add a dummy non-empty environment when using assert_python_{failure,ok} #227

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

Merged
merged 1 commit into from
Mar 17, 2025

Conversation

ellert
Copy link
Contributor

@ellert ellert commented Mar 14, 2025

If the env_vars argument to assert_python_failure or assert_python_ok is empty the test will run in isolated mode (-I) which means that the PYTHONPATH environment variable will be ignored and the test fails because the isal module can not be found, or the test is run usung the system installed version of the module instead of the newly built module that should be tested.

By adding a dummy entry to the env_vars argument the isolated mode is not used and the PYTHONPATH environment variable is not ignored and the test works as expected.

Checklist

  • Pull request details were added to CHANGELOG.rst
  • Documentation was updated (if needed)

If the env_vars argument to assert_python_failure or assert_python_ok
is empty the test will run in isolated mode (-I) which means that the
PYTHONPATH environment variable will be ignored and the test fails
because the isal module can not be found, or the test is run usung the
system installed version of the module instead of the newly built
module that should be tested.

By adding a dummy entry to the env_vars argument the isolated mode is
not used and the PYTHONPATH environment variable is not ignored and
the test works as expected.
@rhpvorderman
Copy link
Collaborator

Looks good! Could you add the explanation in a comment in the code somewhere? These dummy vars are going to be a bit puzzling without the proper context.

@ellert
Copy link
Contributor Author

ellert commented Mar 17, 2025

Could you add the explanation in a comment in the code somewhere?

I have put a comment in the code.

@rhpvorderman
Copy link
Collaborator

Looks good to me! Is this part of some packaging project given the type of bugs you are unearthing?

@rhpvorderman rhpvorderman merged commit 26cf5d2 into pycompression:develop Mar 17, 2025
20 checks passed
@ellert ellert deleted the non-empty-env branch March 17, 2025 16:13
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