Summary for @GeraldEV (or other reviewers): This PR:
It moves existing code to make it commonly usable.
It adds support for executing the tests with the newer Python3 builds provided in GitHub actions
It is tested in GitHub CI
Details
Converts the existing pytest fixture to test functions of xen-bugtool to a common pytest fixtures:
Moves the bugtool test fixture from the existing test case into pytest's conftest.py to make it available for all unit tests which need to test bugtool functions for updating them to support Python3.
To support using the test fixture with newer Python versions, add modern import loader using importlib.
Outlook of it's use, just as information beforehand:
The Python3 migration of xen-bugtool is really tricky (PRs will be documented, details then for each one):
This test fixture will be used by many unit tests to test bugtool functions before and after adding Python3 support to ensure that the changes do not harm (change behavior) of the code in any way!
This will be done in a test-driven manner (Test-Driven Development):
To ensure that the test case is correct for the behavior of the existing code,
tests running on Python2 (in GitHub CI) will be added with an initial commit!
Python3 changes will be applied, without any change to the test case except for opening it's execution on Python3 to enable testing. Again, with verification using GitHub CI.
Summary for @GeraldEV (or other reviewers): This PR:
Details
Converts the existing
pytest
fixture to test functions ofxen-bugtool
to a common pytest fixtures:bugtool
test fixture from the existing test case intopytest
'sconftest.py
to make it available for all unit tests which need to testbugtool
functions for updating them to support Python3.importlib
.Outlook of it's use, just as information beforehand:
The Python3 migration of
xen-bugtool
is really tricky (PRs will be documented, details then for each one):This test fixture will be used by many unit tests to test
bugtool
functions before and after adding Python3 support to ensure that the changes do not harm (change behavior) of the code in any way!This will be done in a test-driven manner (Test-Driven Development):
All commits should show a green checkmark symbol.