Skip to content
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

pytest warning fixes #2103

Merged
merged 3 commits into from
Jun 1, 2023
Merged

pytest warning fixes #2103

merged 3 commits into from
Jun 1, 2023

Conversation

martinhoyer
Copy link
Collaborator

  1. Opportunistically use "selectable" entry_points.
    The “selectable” entry points were introduced in importlib_metadata 3.6 and Python 3.10.
    While this could be solved by adding entry_points>=3.6 for python<3.10 as a dependency, python3-importib-metadata el8 package currently only have version 0.23.
    See: DeprecationWarning: SelectableGroups dict interface is deprecated. Use select. python/importlib_metadata#298
    Fixes:
tmt/plugins/__init__.py:116
  /opt/tmt/lib64/python3.11/site-packages/tmt/plugins/__init__.py:116: DeprecationWarning: SelectableGroups dict interface is deprecated. Use select.
    for found in entry_points()[entry_point]:
  1. The markings pytest.ini does not seem to be working properly.
    Taking this as an opportunity to move it to pyproject.toml and deleting pytest.ini
    Fixes:
tests/unit/test_beakerlib.py:56
  /root/tmt/tests/unit/test_beakerlib.py:56: PytestUnknownMarkWarning: Unknown pytest.mark.web - is this a typo? 
  1. tmpdir was missing explicit convertion to str here:
tests/unit/test_utils.py::test_workdir_env_var
  /root/tmt/tests/unit/test_utils.py:179: PytestWarning: Value of environment variable TMT_WORKDIR_ROOT type should be str, but got local('/tmp/pytest-of-root/pytest-2/test_workdir_env_var0') (type: LocalPath); converted to str implicitly

@happz happz added no functional change "No Functional Change" intended. Patch should not change tmt's behavior in any way. tmt tests Improvements or additions to test coverage of tmt itself labels May 22, 2023
Indirectly fixes pytest warnings for "web" markers.
The “selectable” entry points were introduced in importlib_metadata 3.6 and Python 3.10.
While this could be solved by adding entry_points>=3.6 for python<3.10 as a dependency, python3-importib-metadata el8 package currently only have version 0.23.
Fixes deprecation warnings.
See: python/importlib_metadata#298
@happz happz added this to the 1.24 milestone Jun 1, 2023
@happz happz merged commit 6566c89 into teemtee:main Jun 1, 2023
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no functional change "No Functional Change" intended. Patch should not change tmt's behavior in any way. tmt tests Improvements or additions to test coverage of tmt itself
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants