prospector
prospector copied to clipboard
Mechanical fix/workaround for `tests/tools/pyroma/test_pyroma_tool.py`
Description
This PR provides a mechanical fix/workaround (ie not a fix at the root cause, please see below for reasoning) for the failed test
Testing steps
- tested locally (on my machine) following the test steps from the Github Action (GA) workflow: result: 100% pass rate
- tested on GA via my personal fork: I replicated the test failure one can see on the main
master
Clues: the files.files
are identical on both machines; the messages
indeed differ by two elements:
- Files and messages on local machine:
[PosixPath('/home/valeriu/prospector-fork/tests/tools/pyroma/testdata/pkg1/__init__.py'), PosixPath('/home/valeriu/prospector-fork/tests/tools/pyroma/testdata/pkg1/this_one_is_fine/setup.py'), PosixPath('/home/valeriu/prospector-fork/tests/tools/pyroma/testdata/pkg1/this_one_is_fine/__init__.py')]
[pyroma-PYR05, pyroma-PYR06, pyroma-PYRUNKNOWN, pyroma-PYR09, pyroma-PYR12, pyroma-PYR05, pyroma-PYR06, pyroma-PYRUNKNOWN, pyroma-PYR09, pyroma-PYR12]
- Files and messages on GA machine:
[PosixPath('/home/runner/work/prospector/prospector/tests/tools/pyroma/testdata/pkg1/__init__.py'), PosixPath('/home/runner/work/prospector/prospector/tests/tools/pyroma/testdata/pkg1/this_one_is_fine/__init__.py'), PosixPath('/home/runner/work/prospector/prospector/tests/tools/pyroma/testdata/pkg1/this_one_is_fine/setup.py')]
[pyroma-PYR05, pyroma-PYR06, pyroma-PYRUNKNOWN, pyroma-PYR09, pyroma-PYR12, pyroma-PYRUNKNOWN, pyroma-PYR05, pyroma-PYR06, pyroma-PYRUNKNOWN, pyroma-PYR09, pyroma-PYR12, pyroma-PYRUNKNOWN]
As you can see, the GA results include two additional pyroma-PYRUNKNOWN
members in the messages
list. My theory is that the setup.py
file gets a little bit altered (trailing space character, newline character etc - could be anything non-major - something minor) which gives differing results at the point of pyroma run. File system peculiarities, I reckon.
PS: I've kept the change to the GA workflow file for possible further testing, I'll remove that if this will get merged. Cheers, fellas :beer:
Related Issue
This failing test needs be fixed so we can get #645 in and consequently release a version that supports Python 3.12
Motivation and Context
Fixes failing test tests/tools/pyroma/test_pyroma_tool.py
How Has This Been Tested?
Types of changes
- [x] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
Checklist:
- [x] My code follows the code style of this project.
- [ ] My change requires a change to the documentation.
- [ ] I have updated the documentation accordingly.
- [ ] My change requires a change to the dependencies
- [ ] I have updated the dependencies accordingly
- [x] I have read the CONTRIBUTING document.
- [x] I have added tests to cover my changes.
- [ ] All new and existing tests passed.