Re: [gdal-dev] More consistent use of pytest's parameterization in autotests

2023-02-20 Thread Kurt Schwehr
Agreed about test interdependency being rough. Internally at work, we have a test runner that intentionally does not run tests in order. All the autotest2 stuff I did should all be order independent. Sadly, my old tests are using pythons normal test setup, not pytest. On Mon, Feb 20, 2023, 7:57

Re: [gdal-dev] More consistent use of pytest's parameterization in autotests

2023-02-20 Thread Sean Gillies
I thought about writing something down, too, but didn't see anything about writing tests at https://gdal.org/development/testing.html and I decided I wasn't qualified to start a new section about testing standards. On Mon, Feb 20, 2023, 10:52 AM Even Rouault wrote: > Hi Sean, > > I fully agree t

Re: [gdal-dev] More consistent use of pytest's parameterization in autotests

2023-02-20 Thread Even Rouault
Hi Sean, I fully agree that pytest.mark.parametrize() is cleaner and the way to go, and I use it extensively in new tests. For what you were referring too, this was a change in an existing test that used the old for looping habits, so I felt it was a bit too much to ask the contributor to ref

Re: [gdal-dev] More consistent use of pytest's parameterization in autotests

2023-02-20 Thread Daniel Evans
> Additionally, these loops fix the order that the checks are made, and bugs > can hide in test order dependency. As we're on the topic of pytest, I'll mention fixtures as a handy feature for test setup: https://docs.pytest.org/en/6.2.x/fixture.html I discovered a while back that some parts of t

[gdal-dev] More consistent use of pytest's parameterization in autotests

2023-02-20 Thread Sean Gillies
Hi all, I just saw a maintainer recommend to a contributor that the contributor loop over test cases from within a test function and it prompted me to speak up about a better practice: using pytest parameterization https://docs.pytest.org/en/6.2.x/parametrize.html#pytest-mark-parametrize-parametri