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

Tests are failing with pytest 8.1 #1879

Open
2 tasks
micahellison opened this issue Mar 28, 2024 · 3 comments
Open
2 tasks

Tests are failing with pytest 8.1 #1879

micahellison opened this issue Mar 28, 2024 · 3 comments
Labels
test Issues related to tests we need to add

Comments

@micahellison
Copy link
Member

Tests have been working with pytest 8.0 but not pytest 8.1.1. Discovered in #1878.

A fix to this ticket:

  • Removes the upper version constrain to pytest in pyproject.toml ([tool.poetry.dev-dependencies] and [testenv])
  • Fixes the failed tests
@micahellison micahellison added the test Issues related to tests we need to add label Mar 28, 2024
@micahellison
Copy link
Member Author

It looks like the output from the very first "When we run" statement is being captured, but when there are subsequent "When we run" statements in the same test, the output of those statements is no longer being captured.

It does seem related to inject_fixture in pytest bdd, since that's related to the only documented breaking change in pytest 8.1, but I'm not sure how exactly.

@musicinmybrain
Copy link
Contributor

I’m keeping an eye on this, as we’re about to update to pytest 8.3 from 7.4.3 in Fedora Rawhide. In the short term, there are a few other packages that will need a python-pytest7 compat package, so jrnl can use that. In the medium term, it may become necessary to stop running jrnl’s tests in Fedora if this can’t be resolved.

It seemed like pytest-dev/pytest-bdd#689 and pytest-dev/pytest-bdd#690 could have been be related, but I tried applying that PR as a downstream patch to python-pytest-bdd and it didn’t seem to make any difference to the test failures in jrnl.

@musicinmybrain
Copy link
Contributor

It seemed like pytest-dev/pytest-bdd#689 and pytest-dev/pytest-bdd#690 could have been be related, but I tried applying that PR as a downstream patch to python-pytest-bdd and it didn’t seem to make any difference to the test failures in jrnl.

I’m not sure if something changed, or if I tested incorrectly before, but I just tried this again (applying pytest-dev/pytest-bdd#690 as a patch to pytest-bdd 7.2.0 and running tests from jrnl 4.1, patched with #1878, using pytest 8.3.1), and it worked. So it seems that PR is in fact the solution to this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
test Issues related to tests we need to add
Projects
None yet
Development

No branches or pull requests

2 participants