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

Upgrade the test sequence for pytest >= 8 #735

Merged
merged 5 commits into from
Feb 5, 2024
Merged

Conversation

lfarv
Copy link
Contributor

@lfarv lfarv commented Jan 31, 2024

The recent release of pytest 8.0.0 broke the test sequence. This is due to an incompatibility of the pytest_lazy_fixture package with pytest 8.0.0. Looking around, it seems very unlikely that pytest_lazy_fixture will be updated: it's now abandoned for 5 years.

A temporary solution in #734 was to pin pytest to <8.0. In this PR we get rid of pytest_lazy_fixture.

Note to developers: when upgrading to pytest 8.0.0 (now possible with this branch). you must uninstall pytest_lazy_fixture.

Note to reviewers: formatting the modified files with "black" unfortunately introduced a lot of cosmetic changes. The only real change was to replace all occurrences of lines like:

@pytest.mark.parametrize('lattice',
                         [pytest.lazy_fixture('dba_lattice'),
                          pytest.lazy_fixture('hmba_lattice')])
def test_linopt6_norad(lattice):

with:

@pytest.mark.parametrize("lattice", ["dba_lattice", "hmba_lattice"])
def test_linopt6_norad(request, lattice):
    lattice = request.getfixturevalue(lattice)

Using the request fixture.

@lfarv lfarv added the Python For python AT code label Jan 31, 2024
Copy link
Contributor

@swhite2401 swhite2401 left a comment

Choose a reason for hiding this comment

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

Ok for me

@swhite2401
Copy link
Contributor

Would it possible to merge this rapidly? Thanks!

@lfarv lfarv merged commit f1b1602 into master Feb 5, 2024
37 checks passed
@lfarv lfarv deleted the remove_pytest_lazy_fixture branch February 5, 2024 17:52
@lfarv lfarv mentioned this pull request Feb 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Python For python AT code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants