Updating python-jsonschema: fixture 'issue' not found
Hi all, ansible-lint requires a very recent version of python-jsonschema. Unfortunately, I get an error when building 4.10.0 or later:
[ 60s] file /home/abuild/rpmbuild/BUILD/jsonschema-4.10.0/jsonschema/tests/_helpers.py, line 21 [ 60s] def test_suite_bug(issue): [ 60s] E fixture 'issue' not found [ 60s] > available fixtures: cache, capfd, capfdbinary, caplog, capsys, capsysbinary, doctest_namespace, monkeypatch, pytestconfig, record_property, record_testsuite_property, record_xml_attribute, recwarn, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory [ 60s] > use 'pytest --fixtures [testpath]' for help on them.
https://build.opensuse.org/project/monitor/home:ojkastl_buildservice:Branch_...
Unfortunately "issue" is a bad keyword for an internet search, as it comes up with lots of GitHub issues for pytest... :-) This issue looks familiar, unfortunately bug reporter and upstream seem to have some history and thus there is no solution:
Does anyone have a hint for me? Am I missing a BuildRequires or just a newer version of pytest? I am not familiar enough with the internals of python testing to judge if there is another way to do that. Any help is highly appreciated. Kind Regards, Johannes -- Johannes Kastl Linux Consultant & Trainer Tel.: +49 (0) 151 2372 5802 Mail: kastl@b1-systems.de B1 Systems GmbH Osterfeldstraße 7 / 85088 Vohburg http://www.b1-systems.de GF: Ralph Dehner Unternehmenssitz: Vohburg / AG: Ingolstadt,HRB 3537
On 25.09.22 at 14:18 Johannes Kastl wrote:
Does anyone have a hint for me? Am I missing a BuildRequires or just a newer version of pytest? I am not familiar enough with the internals of python testing to judge if there is another way to do that.
I just replaced the pytest call with a simple "tox --skip-missing-interpreters". And the package is still building (locally) and tests are still running. Let's see if it works... Kind Regards, Johannes -- Johannes Kastl Linux Consultant & Trainer Tel.: +49 (0) 151 2372 5802 Mail: kastl@b1-systems.de B1 Systems GmbH Osterfeldstraße 7 / 85088 Vohburg http://www.b1-systems.de GF: Ralph Dehner Unternehmenssitz: Vohburg / AG: Ingolstadt,HRB 3537
Hi, Am 25.09.22 um 14:18 schrieb Johannes Kastl:
Hi all,
ansible-lint requires a very recent version of python-jsonschema. Unfortunately, I get an error when building 4.10.0 or later:
[ 60s] file /home/abuild/rpmbuild/BUILD/jsonschema-4.10.0/jsonschema/tests/_helpers.py, line 21 [ 60s] def test_suite_bug(issue): [ 60s] E fixture 'issue' not found [ 60s] > available fixtures: cache, capfd, capfdbinary, caplog, capsys, capsysbinary, doctest_namespace, monkeypatch, pytestconfig, record_property, record_testsuite_property, record_xml_attribute, recwarn, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory [ 60s] > use 'pytest --fixtures [testpath]' for help on them.
https://build.opensuse.org/project/monitor/home:ojkastl_buildservice:Branch_...
Unfortunately "issue" is a bad keyword for an internet search, as it comes up with lots of GitHub issues for pytest... :-)
This issue looks familiar, unfortunately bug reporter and upstream seem to have some history and thus there is no solution:
Putting aside that the issue reporter has a history of spamming issue trackers of various packages without knowing what he is doing, the answer by the package author gives a hint: jsonschema is not to be tested with pytest directly. Unfortunately, using tox is not viable in an rpm package either, because tox installs everything in a separate testing environment. Your local tests (with online access I assume) work, in obs it is not able to download the needed packages. Have a look at tox.ini: The crucial call is here: https://github.com/python-jsonschema/jsonschema/blob/ee024ffc61bee56b25e816f... tests,coverage,codecov: {envpython} -Werror -W"ignore:module 'sre_constants' is deprecated:DeprecationWarning"-m {env:MAYBE_COVERAGE:} twisted.trial {posargs:jsonschema} So tox does not call pytest but uses twisted.trial See sr#1005905 HTH, Ben
Hi Ben, On 25.09.22 at 19:25 Ben Greiner wrote:
Putting aside that the issue reporter has a history of spamming issue trackers of various packages without knowing what he is doing, the answer by the package author gives a hint: jsonschema is not to be tested with pytest directly.
That I understood.
Unfortunately, using tox is not viable in an rpm package either, because tox installs everything in a separate testing environment. Your local tests (with online access I assume) work, in obs it is not able to download the needed packages.
That I found out.
Have a look at tox.ini: The crucial call is here:
https://github.com/python-jsonschema/jsonschema/blob/ee024ffc61bee56b25e816f...
tests,coverage,codecov: {envpython} -Werror -W"ignore:module 'sre_constants' is deprecated:DeprecationWarning"-m {env:MAYBE_COVERAGE:} twisted.trial {posargs:jsonschema}
So tox does not call pytest but uses twisted.trial
Now that you explained it it makes a little sense to me... :-)
See sr#1005905
Thanks a lot for your help, I would never have gotten that together with my limited python packaging skills. Kind Regards, Johannes -- Johannes Kastl Linux Consultant & Trainer Tel.: +49 (0) 151 2372 5802 Mail: kastl@b1-systems.de B1 Systems GmbH Osterfeldstraße 7 / 85088 Vohburg http://www.b1-systems.de GF: Ralph Dehner Unternehmenssitz: Vohburg / AG: Ingolstadt,HRB 3537
participants (2)
-
Ben Greiner
-
Johannes Kastl