pacparser
pacparser copied to clipboard
tests: Fix python path in runtests.py
Note: Please review that I am solving this correctly, thanks!
In Gentoo the runtests.py
script fails when it fails to determine the pacparser path.
This happens because py_ver
expands to 3.9
when the expected directory ends in 39
. This can be solved by replacing any periods in the string.
python ../tests/runtests.py
Traceback (most recent call last):
File "/tmp/pacparser/src/../tests/runtests.py", line 31, in runtests
pacparser_module_path = glob.glob(os.path.join(
IndexError: list index out of range
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/tmp/pacparser/src/../tests/runtests.py", line 81, in <module>
main()
File "/tmp/pacparser/src/../tests/runtests.py", line 78, in main
runtests(pacfile, testdata, tests_dir)
File "/tmp/pacparser/src/../tests/runtests.py", line 34, in runtests
raise Exception('Tests failed. Could not determine pacparser path.')
Exception: Tests failed. Could not determine pacparser path.
Full build log: pacparser.pymod.log
Reproduction: make -C src pymod
Seems some of the CI tests aren't happy with this idea...
My second attempt works for CI and local builds at least.
Thanks a lot @orbea for this PR. We don't need this anymore though -- #142 fixes both setup.py and runtests.py.