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_systemsmanagement_ansible

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:
https://github.com/python-jsonschema/jsonschema/issues/980

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/ee024ffc61bee56b25e816f489d7365fe1445c6d/tox.ini#L30

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