Skip to content
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

1.5.0: pytest is failing #797

Closed
kloczek opened this issue May 18, 2021 · 7 comments
Closed

1.5.0: pytest is failing #797

kloczek opened this issue May 18, 2021 · 7 comments

Comments

@kloczek
Copy link

kloczek commented May 18, 2021

+ /usr/bin/python3 -Bm pytest -ra
=========================================================================== test session starts ============================================================================
platform linux -- Python 3.8.9, pytest-6.2.4, py-1.10.0, pluggy-0.13.1
rootdir: /home/tkloczko/rpmbuild/BUILD/invoke-1.5.0, configfile: setup.cfg, testpaths: tests
plugins: forked-1.3.0, shutil-1.7.0, virtualenv-1.7.0, expect-1.1.0, cov-2.11.1, httpbin-1.0.0, xdist-2.2.1, flake8-1.0.7, timeout-1.4.2, betamax-0.8.1, pyfakefs-4.4.0, freezegun-0.4.2, cases-3.4.6, case-1.5.3, isort-1.3.0, aspectlib-1.5.2, mock-3.6.0, asyncio-0.15.1, toolbox-0.5, xprocess-0.17.1, flaky-3.7.0, requests-mock-1.9.2, aiohttp-0.3.0, checkdocs-2.7.0, hypothesis-6.12.1, relaxed-1.1.5
collected 0 items / 1 error

================================================================================== ERRORS ==================================================================================
______________________________________________________________________ ERROR collecting test session _______________________________________________________________________
Direct construction of SpecModule has been deprecated, please use SpecModule.from_parent.
See https://docs.pytest.org/en/stable/deprecations.html#node-construction-changed-to-node-from-parent for more details.
========================================================================= short test summary info ==========================================================================
ERROR
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
============================================================================= 1 error in 0.42s =============================================================================
@GregHilston
Copy link

Interesting, I'm able to run pytest. Relevent versions:

  • invoke: 1.5.0
  • pytest: 6.2.4

Here's my command I'm running $ poetry run pytest

and my output

============================= test session starts ==============================
platform linux -- Python 3.8.2, pytest-6.2.4, py-1.10.0, pluggy-0.13.1
rootdir: /home/ghilston/Git/ghilston-python-cookiecutter
plugins: cov-2.12.0
collected 1 item

test/test_app.py .   

_this is an example repository so the output is probably not to excited

@felixonmars
Copy link

@kloczek I did some tracing and the problem comes from pytest-relaxed:

[...]e-packages/pytest_relaxed/plugin.py:21    line         if (
[...]e-packages/pytest_relaxed/plugin.py:31    line         return SpecModule(path, parent)
[...]e-packages/pytest_relaxed/plugin.py:31    exception  ! pytest_collect_file: (<class 'Failed'>, Failed('Direct construction of SpecModule has been deprecated, please use SpecModule.from_parent.\nSee https://docs.pytest.org/en/stable/deprecations.html#node-construction-changed-to-node-from-parent for more details.'), <traceback object at 0x7fe8eb0b5b40>)

Ref: bitprophet/pytest-relaxed#12

@kloczek
Copy link
Author

kloczek commented Aug 9, 2021

May I ask you how you've done such tracing?
Is it any documentation describing such techque?

Thx.
PS. as it looks that it is indeed pytest-relaxed issue feel free to close that ticket.

@felixonmars
Copy link

I used https://github.com/ionelmc/python-hunter. A basic example would be PYTHONHUNTER="Q(module_startswith='pytest')" pytest in invoke's project dir.

Hope this helps :)

@kloczek
Copy link
Author

kloczek commented Jan 4, 2022

Looks like other modules are moving away from pytest-relaxed because it is some alternative solution paramiko/paramiko@5844aa0

@bdrung
Copy link

bdrung commented May 16, 2022

This issues blocks us from running the invoke test suite in the Debian/Ubuntu package, because we have pytest 6 in Debian/Ubuntu and pytest-relaxed does not support pytest 6 (see bitprophet/pytest-relaxed#12).

@kloczek
Copy link
Author

kloczek commented Apr 10, 2023

Closing.
Will open new ticket against 2.0.0

@kloczek kloczek closed this as completed Apr 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants