Join GitHub today
utils/hooks : is_module_satisfies() now returns the correct result for packages not found on the system. #3481
Thanks for the pull-request - that's been quick :-)
- The appvayor failures are unrelated to this change, so don't worry.
- Please add a test-case, too, so we will not be trapped by this again.
- Please rethink the commit message.
- Is it important that you added an empty string check, or that is_module_satisfies() returns False for packages that are not installed?
- Please recheck also the sub-system prefix :-)
- Also mind writing the first line in present tense, see Content of the commit message (also updating pull-reqeusts might be helpful.)
referenced this pull request
Apr 25, 2018
Sorry for not answering earlier. Rebasing is a plus, although not necessary, as I can "merge rebase" :-) Not sure what you mean with "four commits". One commit would be enough.
Should the test for the module go into pyinstaller/tests/unit/test_hookutils.py? Here's the module I wrote.
def test_is_module_satisfies_package_not_installed(): assert is_module_satisfies("xyz")
Is this correct? Or does the PR still need changes.
Right, tests/unit/test_hookutils.py is the place to go.
The test-case looks good (but you should test it locally first :-) while I suggest to use a very unlikely package name, e.g. "magnumopus21-testcase-for-pytinsaller-package" ;-)
Also a "positive" test-case would be good. Maybe "pytest" is a good choice, since it is required for running test tests. As a safety belt you could agument it with