Skip to content

4.10.0: pytest is failing #980

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

Closed
kloczek opened this issue Aug 16, 2022 · 4 comments
Closed

4.10.0: pytest is failing #980

kloczek opened this issue Aug 16, 2022 · 4 comments
Labels
Invalid Not a bug, PEBKAC, or an unsupported setup

Comments

@kloczek
Copy link

kloczek commented Aug 16, 2022

I'm packaging your module as an rpm package so I'm using the typical PEP517 based build, install and test cycle used on building packages from non-root account.

  • python3 -sBm build -w --no-isolation
  • because I'm calling build with --no-isolation I'm using during all processes only locally installed modules
  • install .whl file in </install/prefix>
  • run pytest with PYTHONPATH pointing to sitearch and sitelib inside </install/prefix>

I cannot find what provides 'issue' fixture.
Here is pytest output:

+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-jsonschema-4.10.0-2.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-jsonschema-4.10.0-2.fc35.x86_64/usr/lib/python3.8/site-packages
+ /usr/bin/pytest -ra
=========================================================================== test session starts ============================================================================
platform linux -- Python 3.8.13, pytest-7.1.2, pluggy-1.0.0
rootdir: /home/tkloczko/rpmbuild/BUILD/jsonschema-4.10.0
plugins: datadir-1.3.1, regressions-2.3.1, betamax-0.8.1, timeout-2.1.0
collected 7169 items

jsonschema/tests/test_cli.py ..................................................                                                                                      [  0%]
jsonschema/tests/test_deprecations.py .......                                                                                                                        [  0%]
jsonschema/tests/test_exceptions.py ......................................                                                                                           [  1%]
jsonschema/tests/test_format.py ..........                                                                                                                           [  1%]
jsonschema/tests/test_jsonschema_test_suite.py E.............................................s.sss.................................................................. [  3%]
..........ss....s......................................................................................sss.ssss.ss.................................................. [  5%]
................................................................................s................................................................................... [  7%]
..............................................................................................sss................................................................... [  9%]
.....................ss......sssssss.sssss..........................................ss....s......................................................................sss [ 12%]
........ssss.ss.ss..............s................................................................................................................................... [ 14%]
........................................................................................................ss.............ssssss......ss............................... [ 16%]
.................................................................................................................................................................... [ 19%]
..........sssssss................................................................................................................................................... [ 21%]
..................................ss......sssssss.sssss.................................................ss....s..................................................... [ 23%]
...........................................sss........ssss.ss.....................s.............................................................................ssss [ 25%]
ssssssss............................................................................................................................................................ [ 28%]
...............................................................ss...............................ss.................................................................. [ 30%]
.................................................................................................................................................................ss. [ 32%]
........s.............sssssss....................................................................................................................................... [ 35%]
............................................ss..s..s.......ss......sssssss.sssss.................................................................................... [ 37%]
........ss....s................................................................................................................................................sss.. [ 39%]
......ssss.ss............................................................................................................s.......................................... [ 41%]
...........ss...........ssss...................................ssssssssssss......................................................................................... [ 44%]
..................................................................................................................................ss...............................s [ 46%]
sss..................................................s..........ssss..................s..........sssssssssssssssssssssssss.......................................... [ 48%]
...............................................................................................................................ss.........s.............sssssss..... [ 51%]
........................................................................ss.......................................................................................... [ 53%]
......................................................s............................................................................................................. [ 55%]
....................................................................................sssssss......................................................................... [ 57%]
.................................................................................................................................................................... [ 60%]
.......................................................................ss.sss..s.s..s....ss..s.s..s......................................ss......................... [ 62%]
.......................................................................................................................s................s.s...s.s......s..s..s.s.s.. [ 64%]
.................................................................................................................................................................... [ 67%]
.................s.....ss......sssssss.sssss..................................................ss.sssss....s.s..........ss....ssss........ssss.ss.................... [ 69%]
.....................................................s.....................................................ss...........ssss.......ssssssssssss..................... [ 71%]
......s..........ssss..s..........sssssssssssssssssssssssss..................ss.........s.............sssssss....................................................... [ 74%]
.....................ss............................................................................................................................................. [ 76%]
.s.......................................s.............ss.ss.s.s.s.................................................................................................. [ 78%]
.................................................................................................................................................................... [ 80%]
.................................................................................................................................................................... [ 83%]
.........................................................................................ss......................................................................... [ 85%]
.................................................................................................................................................................... [ 87%]
..................................................................................................................................................s.....ss......ssss [ 90%]
sss.sssss..................................................ss.sssss....s.s..............ss.ss....ssss........ssss.ss................................................ [ 92%]
.........................s.....................................................ss...........ssss.......ssssssssssss...........................s..........ssss..s.... [ 94%]
......sssssssssssssssssssssssss..................ss.........s.............sssssss...............                                                                     [ 95%]
jsonschema/tests/test_types.py ..............                                                                                                                        [ 96%]
jsonschema/tests/test_utils.py .......................                                                                                                               [ 96%]
jsonschema/tests/test_validators.py ................................................................................s.s..........................s.s................ [ 98%]
..............................................................................................................................                                       [100%]

================================================================================== ERRORS ==================================================================================
_____________________________________________________________________ ERROR at setup of test_suite_bug _____________________________________________________________________
file /home/tkloczko/rpmbuild/BUILD/jsonschema-4.10.0/jsonschema/tests/_helpers.py, line 21
  def test_suite_bug(issue):
E       fixture 'issue' not found
>       available fixtures: betamax_parametrized_recorder, betamax_parametrized_session, betamax_recorder, betamax_session, cache, capfd, capfdbinary, caplog, capsys, capsysbinary, data_regression, datadir, dataframe_regression, doctest_namespace, file_regression, image_regression, monkeypatch, ndarrays_regression, num_regression, original_datadir, pytestconfig, record_property, record_testsuite_property, record_xml_attribute, recwarn, shared_datadir, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory
>       use 'pytest --fixtures [testpath]' for help on them.

/home/tkloczko/rpmbuild/BUILD/jsonschema-4.10.0/jsonschema/tests/_helpers.py:21
========================================================================= short test summary info ==========================================================================
SKIPPED [64] jsonschema/tests/_suite.py:191: Format checker 'date-time' not found.
SKIPPED [20] jsonschema/tests/_suite.py:191: Complex email validation is (intentionally) unsupported.
SKIPPED [9] jsonschema/tests/_suite.py:191: Format checker 'host-name' not found.
SKIPPED [6] jsonschema/tests/_suite.py:191: A known bug. See https://github.com/python-jsonschema/jsonschema/issues/371.
SKIPPED [38] jsonschema/tests/_suite.py:191: Format checker 'uri' not found.
SKIPPED [28] jsonschema/tests/_suite.py:188: Leap seconds are unsupported.
SKIPPED [45] jsonschema/tests/_suite.py:191: Format checker 'hostname' not found.
SKIPPED [5] jsonschema/tests/_suite.py:188: A known bug. See https://github.com/python-jsonschema/jsonschema/issues/371.
SKIPPED [5] jsonschema/tests/_suite.py:191: Rejecting leading zeros is 3.9+
SKIPPED [8] jsonschema/tests/_suite.py:188: A known bug.
SKIPPED [8] jsonschema/tests/_suite.py:191: A known bug.
SKIPPED [48] jsonschema/tests/_suite.py:191: Format checker 'json-pointer' not found.
SKIPPED [8] jsonschema/tests/_suite.py:191: Format checker 'uri-reference' not found.
SKIPPED [4] jsonschema/tests/_suite.py:191: Format checker 'uri-template' not found.
SKIPPED [4] jsonschema/tests/_suite.py:191: A known bug. See https://github.com/python-jsonschema/jsonschema/issues/593.
SKIPPED [6] jsonschema/tests/_suite.py:191: Format checker 'iri-reference' not found.
SKIPPED [12] jsonschema/tests/_suite.py:191: Format checker 'iri' not found.
SKIPPED [15] jsonschema/tests/_suite.py:191: Format checker 'relative-json-pointer' not found.
SKIPPED [60] jsonschema/tests/_suite.py:191: Format checker 'time' not found.
SKIPPED [9] jsonschema/tests/_suite.py:191: dynamicRef support isn't fully working yet.
SKIPPED [5] jsonschema/tests/_suite.py:188: dynamicRef support isn't fully working yet.
SKIPPED [18] jsonschema/tests/_suite.py:191: recursiveRef support isn't working yet.
SKIPPED [2] jsonschema/tests/_suite.py:188: recursiveRef support isn't working yet.
SKIPPED [10] jsonschema/tests/_suite.py:191: unevaluatedItems is different in 2019-09 (needs work).
SKIPPED [2] jsonschema/tests/_suite.py:188: A known test suite bug. See https://github.com/json-schema-org/JSON-Schema-Test-Suite/issues/574.
SKIPPED [18] jsonschema/tests/_suite.py:191: Format checker 'duration' not found.
SKIPPED [2] jsonschema/tests/test_validators.py:1667: A known bug. See https://github.com/python-jsonschema/jsonschema/issues/523.
SKIPPED [2] jsonschema/tests/test_validators.py:1660: A known bug. See https://github.com/python-jsonschema/jsonschema/issues/523.
ERROR jsonschema/tests/test_jsonschema_test_suite.py::test_suite_bug
=============================================================== 6707 passed, 461 skipped, 1 error in 19.02s ================================================================

list of modules installed in build env

Package                       Version
----------------------------- -----------------
alabaster                     0.7.12
attrs                         22.1.0
Automat                       20.2.0
Babel                         2.10.2
Brlapi                        0.8.3
build                         0.8.0
certifi                       2021.10.8
charset-normalizer            2.1.0
codespell                     2.1.0
constantly                    15.1.0
cycler                        0.11.0
distro                        1.7.0
docutils                      0.18.1
editables                     0.3
extras                        1.0.0
fixtures                      4.0.0
fonttools                     4.34.4
gpg                           1.17.1-unknown
hatch-vcs                     0.2.0
hatchling                     1.7.0
hyperlink                     21.0.0
idna                          3.3
imagesize                     1.4.1
importlib-metadata            4.12.0
importlib-resources           5.9.0
incremental                   21.3.0
iniconfig                     1.1.1
Jinja2                        3.1.1
kiwisolver                    1.4.4
libcomps                      0.1.18
louis                         3.22.0
lxml                          4.9.1
MarkupSafe                    2.1.1
matplotlib                    3.5.3
mypy                          0.971
mypy-extensions               0.4.3
numpy                         1.23.1
olefile                       0.46
packaging                     21.3
pathspec                      0.9.0
pbr                           5.9.0
pep517                        0.12.0
Pillow                        9.2.0
pip                           22.2.1
pkgutil_resolve_name          1.3.10
pluggy                        1.0.0
py                            1.11.0
pyenchant                     3.2.2
Pygments                      2.13.0
PyGObject                     3.42.2
pyparsing                     3.0.9
pyrsistent                    0.18.1
pytest                        7.1.2
python-dateutil               2.8.2
pytz                          2022.1
requests                      2.28.1
rpm                           4.17.0
setuptools                    64.0.3
setuptools-scm                7.0.5
six                           1.16.0
snowballstemmer               2.2.0
Sphinx                        5.1.1
sphinx-autodoc-typehints      1.19.2
sphinxcontrib-applehelp       1.0.2.dev20220730
sphinxcontrib-devhelp         1.0.2.dev20220730
sphinxcontrib-htmlhelp        2.0.0
sphinxcontrib-jsmath          1.0.1.dev20220730
sphinxcontrib-qthelp          1.0.3.dev20220730
sphinxcontrib-serializinghtml 1.1.5
sphinxcontrib-spelling        7.5.0
testtools                     2.5.0
tomli                         2.0.1
Twisted                       22.4.0
typing_extensions             4.2.0
urllib3                       1.26.11
webcolors                     1.12
wheel                         0.37.1
zipp                          3.8.1
zope.event                    4.5.0
zope.interface                5.4.0
@Julian
Copy link
Member

Julian commented Aug 16, 2022

This isn't supported, though it should be trivial to fix (and involves you tweaking some pytest config presumably), which is something I've mentioned multiple times before in various ways (#807 #895 #837). This is a last warning to please not waste my time. If you're doing something unsupported because you feel like it, great, but unsupported means it's not something I want to spend time helping with.

@Julian Julian closed this as not planned Won't fix, can't repro, duplicate, stale Aug 16, 2022
@Julian Julian added the Invalid Not a bug, PEBKAC, or an unsupported setup label Aug 16, 2022
@kloczek
Copy link
Author

kloczek commented Aug 16, 2022

  • first ticket is not about the same issue
  • second one was closed without any comments and after few versions pytest started working perfectly
  • in 3rd is mentioned list of dependencies in tox.ini which as you see I have installed
  • this ticked is about something completly new unrelated to all my prev toickets (is this what you want to say?)
  • in none of those tickets you mention that pytest is not supported
  • additionally all 4.9.x versions have been passing pytest used exactly the same way without any issue so it is clear indicatir that it is something new.

Unit fails becaue it cannot find pytest fixture. I've asked only politely where I can find that pytest extension which provides that fixture. As result you are treatening me to ban me. I really have no udea how should reperts issues like this one without be banned.
Could you please provide some adices what shoul I do in situations like this one?

@Julian
Copy link
Member

Julian commented Aug 16, 2022

in none of those tickets you mention that pytest is not supported

I'm going to close this since I'm 99% sure whatever is happening here is something about your own setup. I can again, give you possible working setups, but I just don't have time to help diagnose arbitrary ones. If you want to figure out how to fix your setup, I'd suggest either following the steps the tox.ini performs, running the pip command I showed and getting those versions of the software, or asking on StackOverflow.

from #807 (comment), which is not the only time I've told you this.

second one was closed without any comments and after few versions pytest started working perfectly

I did you a favor by responding here, instead of doing the same to this one.

My advice, bluntly, is figure out your own setup, otherwise use a supported one. I'm not threatening you with banning you, I'm telling you I will close any issues you file about unsupported setups, you've been told that multiple times.

There's no fixture here in this repo. If you want to use pytest, learn to use it and figure out how to tell it there's no fixture in the tests.

@kloczek
Copy link
Author

kloczek commented Aug 16, 2022

from #807 (comment), which is not the only time I've told you this.

In that comment you've mention about use /usr/bin/python3 -Bm pytest -ra.
Pytest should never been called over python -n <foo> because python used taht way automatically adds currrent directory to sys.path. This is why pytest provides pytest script which is imorting module without altering sys.path.

Nevertheless that comment which you've mention is about lack of installed pytest modules in your env. In other worsds thay issu ehas nothing to do with reported here issie.

Did you try to use pytest to reproduce that issue? I'm asking because I don't see any thaces of using pytest in https://github.com/python-jsonschema/jsonschema/blob/main/.github/workflows/ci.yml
Looking on https://github.com/python-jsonschema/jsonschema/issues?q=is%3Aissue+pytest+is%3Aclosed so I'm not only person which is usig pytest.

@python-jsonschema python-jsonschema locked as off-topic and limited conversation to collaborators Aug 16, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Invalid Not a bug, PEBKAC, or an unsupported setup
Projects
None yet
Development

No branches or pull requests

2 participants