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.

I am getting error "pytest: error: unrecognized arguments: --show-capture=no" while executing tests using pytest

See original GitHub issue

Command i am trying to execute: pytest --show-capture=no -v --dsn="emulator-5554" -m bat --reruns=2

LINE NUMBERS 
usage: pytest [options] [file_or_dir] [file_or_dir] [...]
pytest: error: unrecognized arguments: --show-capture=no
  inifile: /home/ANT.AMAZON.COM/jaiadi/kats-agent/workdir/54/workspace/test/pytest.ini
  rootdir: /home/ANT.AMAZON.COM/jaiadi/kats-agent/workdir/54/workspace/test
usage: pytest [options] [file_or_dir] [file_or_dir] [...]
pytest: error: unrecognized arguments: --show-capture=no
  inifile: /home/ANT.AMAZON.COM/jaiadi/kats-agent/workdir/54/workspace/test/pytest.ini
  rootdir: /home/ANT.AMAZON.COM/jaiadi/kats-agent/workdir/54/workspace/test
usage: pytest [options] [file_or_dir] [file_or_dir] [...]
pytest: error: unrecognized arguments: --show-capture=no
  inifile: /home/ANT.AMAZON.COM/jaiadi/kats-agent/workdir/54/workspace/test/pytest.ini
  rootdir: /home/ANT.AMAZON.COM/jaiadi/kats-agent/workdir/54/workspace/test

Pytest version i am using:

This is pytest version 5.3.5, imported from /home/ANT.AMAZON.COM/jaiadi/kats-ag...-packages/pytest/__init__.py
setuptools registered plugins:
pytest-rerunfailures-8.0 at /home/ANT.AMAZON.COM/jaiadi/kats-ag...ages/pytest_rerunfailures.py
pytest-cov-2.3.1 at /home/ANT.AMAZON.COM/jaiadi/kats-ag...ackages/pytest_cov/plugin.py

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:14 (8 by maintainers)

github_iconTop GitHub Comments

2reactions
neumondcommented, Apr 16, 2020

I think I get why this error happens. Since option is defined in tests/conftest.py it exists inside tests. Whenever I run pytest outside tests I get unrecognized argument error.

1reaction
RonnyPfannschmidtcommented, Mar 15, 2020

Please update the rerunfailures plugin as well, and please start to use the code formatting feature of github, it’s painful to read unformatted pastes

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to fix "pytest: error: unrecognized arguments: -n"
Till now the tests were running perfectly fine. Suddenly the pytest is throwing a weird error saying "unrecognized argument".
Read more >
Pytest ERROR Unrecognized arguments from os.getenv ...
Hi, I'm having trouble getting CircleCI config.yml to handle four command line arguments that my code sets through os.getenv as environment ...
Read more >
pytest Documentation - Read the Docs
When pytest goes to run a test, it looks at the parameters in that test function's signature, and then searches for fixtures.
Read more >
pytest error unrecognized arguments --html basic html - Edureka
Hi Guys,. I am trying to create one Pytest report in HTML format. But It is showing me the below error. C:\Users\Nadeem Akhter\pytest>pytest...
Read more >
multiple arguments to pytest run configuration causes ...
Creating a run/debug configuration to run pytest tests that requires ... _jb_pytest_runner.py: error: unrecognized arguments: –app_config –etl_config .
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