Ask Your Question
1

pytest runner issue

asked 2020-02-19 11:34:12 -0500

andykmiles gravatar image

updated 2020-02-20 15:34:09 -0500

I use WingWare with a project structure generation tool called pyscaffold (its very cool, and helps to ensure all your imports always work). Recently I have started to get errors on Linux and Windows when running pytest tests on pyscaffold projects from within Wingware Pro. On the command line pytest and python setup.py test all work fine. But when I run pytest from within Wing in the same environment I get this error: ERROR: usage: run_pytest_xml.py[options][file_or_dir][file_or_dir][...] run_pytest_xml.py: error: unrecognized arguments: --verbose inifile: c: \Users\chq - andym\projects\mattermost\setup.cfg rootdir: c: \Users\chq - andym\projects\mattermost

I have a setup.cfg that the pyscaffold-created setup.py reads, and the pytest sections look like this:

[tool:pytest] # Options for py.test: # Specify command line options as you would do when invoking py.test directly. # e.g. --cov-report html (or xml) for html/xml output or --junitxml junit.xml # in order to write a coverage file that can be read by Jenkins. addopts = --cov mattermost --cov-report term-missing --verbose norecursedirs = dist build .tox testpaths = tests

If I comment out the --verbose pytest runs I tried changing --verbose to -v and it still fails. Also, I tried --version and -v on the -cov etc line and it still fails

It would be great if this can be fixed. Thanks! And btw, it would be fantastic if Wing could integrate with Pyscaffold in the New Project dialog

edit retag flag offensive close merge delete

Comments

What version of pytest are you using?

Wingware Support gravatar imageWingware Support ( 2020-02-19 16:33:32 -0500 )edit

Python 3.7.4, pytest-5.3.5

andykmiles gravatar imageandykmiles ( 2020-02-19 17:07:59 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2020-02-20 14:05:39 -0500

It works if you remove the --verbose flag. The flag causes problems because Wing adds -p no:terminal arguments to disable displaying results to a terminal and --verbose is not recognized as an argument when -p no:terminal is used (this is a pytest bug). When Wing runs pytest, the output that you normally see is not generated, instead Wing tracks which tests succeed & fail and captures output sent to stdout and stderr by each test.

Also the cov plugin doesn't work with Wing's debugger because both try to use the trace function. This means that you can't debug tests from Wing's Testing tool, which is arguably one of the best reasons to run tests from Wing.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

2 followers

Stats

Asked: 2020-02-19 11:34:12 -0500

Seen: 1,740 times

Last updated: Feb 20