question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Tests are not picked up for pytest >=3.7 on LTS

See original GitHub issue

For some yet unknown reason the tests are not picked up by the test collection only the rst files from the narrative documentation on the LTS branch when using pytest 3.7+

I think at least understanding, preferable fixing, this is critical for the release.

================================================= test session starts ==================================================
platform darwin -- Python 3.7.0, pytest-3.7.4, py-1.6.0, pluggy-0.7.1

Running tests with Astropy version 2.0.10.dev19739.
Running tests in astropy docs.

Date: 2018-11-24T13:44:00

Platform: Darwin-17.7.0-x86_64-i386-64bit

Executable: /usr/local/opt/python/bin/python3.7

Full Python Version: 
3.7.0 (default, Sep 18 2018, 18:47:22) 
[Clang 9.1.0 (clang-902.0.39.2)]

encodings: sys: utf-8, locale: UTF-8, filesystem: utf-8
byteorder: little
float info: dig: 15, mant_dig: 15

Numpy: 1.15.4
Scipy: 1.1.0
Matplotlib: 3.0.2
h5py: 2.8.0
Pandas: 0.23.4
Cython: 0.28.5
astropy_helpers: 3.1rc1
Using Astropy options: remote_data: none.

rootdir: /private/var/folders/dc/hsm7tqpx2d57n7vb3k1l81xw0000gq/T/astropy-test-l155hvv3/lib/python3.7/site-packages, inifile: setup.cfg
plugins: cov-2.6.0, arraydiff-0.2
collected 168 items                                                                                                    

docs/changelog.rst .                                                                                             [  0%]
docs/credits.rst .                                                                                               [  1%]
docs/getting_started.rst .                                                                                       [  1%]
docs/importing_astropy.rst .                                                                                     [  2%]
...
...
docs/whatsnew/2.0.rst .                                                                                          [ 99%]
docs/whatsnew/index.rst .                                                                                        [100%]

============================================== 168 passed in 8.68 seconds ==============================================

cc @dan @eteq @astrofrog

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:12 (10 by maintainers)

github_iconTop GitHub Comments

2reactions
astrofrogcommented, Nov 26, 2018

This is actually fixed in pytest 4.0. It looks like the commit that broke things was https://github.com/pytest-dev/pytest/commit/2b1410895e9ac30c4f08e9a701017cce65a9717b (in https://github.com/pytest-dev/pytest/pull/3389) and the one that fixed it was https://github.com/pytest-dev/pytest/commit/f8b944dee0b59bdc483ce505738ea1cb3a57a5b4 (in https://github.com/pytest-dev/pytest/pull/4319). I think it’s ok to simply say that we don’t support pytest >=3.7,<4 on LTS since it’s a real pytest bug.

1reaction
drdavellacommented, Nov 27, 2018

Also @bsipocz just wanted to mention that using the pytest command is not and will not be supported on LTS, so it’s not surprising that it did not work for you.

Read more comments on GitHub >

github_iconTop Results From Across the Web

VS Code not finding pytest tests - python - Stack Overflow
So first, make sure that the tests could actually be collected by pytest as suggested here: pytest --collect-only.
Read more >
Finding test isolation issues with PyTest
Other times, you see a failing test during a full test-run, then re-run with pytest --lf and suddenly the test is no longer...
Read more >
Changelog — pytest documentation
This is a fix to match a similar change made to test collection itself in pytest 6.0 (see pull request #6523 for details)....
Read more >
pytest Documentation - Read the Docs
Each collected test is assigned a unique nodeid which consist of the module ... By default, pytest will not show test durations that...
Read more >
Effective Python Testing With Pytest
Not only does pytest eliminate a lot of boilerplate, ... effective-python-testing-with-pytest collected 4 items test_with_pytest.py .
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found