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

Switch pytest integration to hook #153

Merged
merged 7 commits into from
Mar 16, 2024

Conversation

mfocko
Copy link
Contributor

@mfocko mfocko commented Mar 7, 2024

Switch the pytest integration to the hook instead of wrapping the runner manually.

Fixes #152

TODO:

  • Adjust specfile for Fedora, cause apparently the pytest module is not included.
    • Decided to use the specfile directly from the Fedora, since the one, here, is not being kept up to date.
  • Rebase
  • Test against 8.1.1
  • Changelog
  • Docstrings

@ollipa
Copy link
Member

ollipa commented Mar 9, 2024

Thank you for the fix! The tests seem to fail for Pytest 5 but I think we should drop support for Pytest 5 in the next release along with Python 3.7.

Copy link
Member

@ollipa ollipa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good and test suite passes! Can you update the CHANGELOG.md?

The linting should pass after you add docstring to the new pytest plugin file.

I made a PR to drop support for Python 3.7 and Pytest 5.x (#154). Feel free to rebase your changes onto that.

It seems that pytest yanked version 8.1.0 so anyone testing this branch should install pytest 8.1.0 explicitly.

src/flexmock/_pytest_plugin.py Outdated Show resolved Hide resolved
src/flexmock/_pytest_plugin.py Show resolved Hide resolved
Sphinx v7 dropped setuptools support and we
still use it.
@mfocko mfocko force-pushed the fix/pytest-integration branch 2 times, most recently from ea8527c to 315c0ba Compare March 11, 2024 20:11
@codecov-commenter
Copy link

codecov-commenter commented Mar 11, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (328a2f6) to head (ba2843a).

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff            @@
##            master      #153   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            4         5    +1     
  Lines          834       832    -2     
=========================================
- Hits           834       832    -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Switch the pytest integration to the hook instead of wrapping the runner
manually.

Fixes flexmock#152

Signed-off-by: Matej Focko <mfocko@redhat.com>
8.1.1 at the time

Signed-off-by: Matej Focko <mfocko@redhat.com>
When running Copr (RPM) build and Testing Farm, download the latest
version of the specfile from the Fedora downstream rather than using an
outdated specfile that is present in the repository.

Also update the config to match the latest state of the Packit Service.

Signed-off-by: Matej Focko <mfocko@redhat.com>
@mfocko
Copy link
Contributor Author

mfocko commented Mar 11, 2024

Sorry about the trouble with the pylint, I'm getting kinda inconsistent results with the make command 👀 locally it fails on mypy already (untyped decorator), also pylint produces way more warnings (mostly newer type aliases for union/optional/etc.)

@ollipa
Copy link
Member

ollipa commented Mar 15, 2024

Sorry about the trouble with the pylint, I'm getting kinda inconsistent results with the make command 👀 locally it fails on mypy already (untyped decorator), also pylint produces way more warnings (mostly newer type aliases for union/optional/etc.)

I think it is just because you are using newer Python version locally. The CI uses the minimum supported Python version.

Thank your work on this. I'll merge this PR soon and create a new release.

@ollipa ollipa merged commit 44a35b3 into flexmock:master Mar 16, 2024
20 checks passed
@mfocko mfocko deleted the fix/pytest-integration branch March 17, 2024 19:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Pytest 8.1.0 removed _pytest.runner.call_runtest_hook
3 participants