atcollab / at

Accelerator Toolbox
Apache License 2.0
48 stars 31 forks source link

Upgrade the test sequence for pytest >= 8 #735

Closed lfarv closed 8 months ago

lfarv commented 8 months ago

The recent release of pytest 8.0.0broke 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.

swhite2401 commented 8 months ago

Would it possible to merge this rapidly? Thanks!