InvocationError when testing via tox but not via pytest called directly
See original GitHub issueI’ve set up a minimally reproducible example as a repo here. The README explains how I’ve invoked the test using pytest directly and with tox, and I can’t figure out why it doesn’t work with tox.
If I’ve made an obvious error in my tox.ini somewhere, I’d appreciate finding out what to fix. This is the only place in the tox code that prints out the InvocationError
without any other information except the command in question (what I’m seeing).
It should also be noted that I can run pytest-qt’s tests with tox just fine. Also, if I comment out the test function’s contents and remove the use of the qtbot
fixture, the test runs fine with tox.
Issue Analytics
- State:
- Created 6 years ago
- Comments:10 (6 by maintainers)
Top Results From Across the Web
Tox InvocationError (exited with code 1) when running pytest
Is it an expected behavior that pytest failure will cause tox command (wrap around the pytest) exited with code 1? Appreciate your insights....
Read more >General tips and tricks — tox 3.4.0 documentation
When a command (defined by commands = in tox.ini ) fails, it has a non-zero exit code, and an InvocationError exception is raised...
Read more >Troubleshooting — pytest-qt documentation - Read the Docs
tox : InvocationError without further information¶ ... pytest-qt needs a DISPLAY to run, otherwise Qt calls abort() and the process crashes immediately. One ......
Read more >tox 3.0.0rc2 - PyPI
tox displays exit code together with InvocationError - by @blueyed and @ederag. ... using the py Python launcher on Windows and the environment...
Read more >Top 5 tox Code Examples - Snyk
Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately. Enable here. github ansible /...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Does adding
passenv = *
under[testenv]
change anything? Can you install thepytest-faulthandler
plugin and run pytest with-s
and see if that gives you anything useful?edit: My best guess would be that
passenv = DISPLAY
fixes thisYou’ll either need to do that or install pytest-xvfb then.
Unfortunately, Qt simply calls
abort()
on that error, and pytest’s output capturing can’t show the error to you as the process was just killed.There’s really not much we can do about this… I wonder if it’d help if pytest-qt disabled the output capturing while creating the
QApplication
though.