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.

Quotation marks in pytest command collects duplicate tests

See original GitHub issue
  • a detailed description of the bug or suggestion Extra single or double quotation marks (‘’ or “”) in pytest command results in duplicate tests in pytest run

  • pip list

Package            Version
------------------ -------
attrs              19.3.0 
importlib-metadata 1.6.0  
more-itertools     8.2.0  
packaging          20.3   
pip                20.0.2 
pkg-resources      0.0.0  
pluggy             0.13.1 
py                 1.8.1  
pyparsing          2.4.6  
pytest             5.4.1  
setuptools         46.1.3 
six                1.14.0 
wcwidth            0.1.9  
wheel              0.34.2 
zipp               3.1.0  
  • pytest and operating system versions
pytest             5.4.1  
Description:	Debian GNU/Linux 10 (buster)
Release:	10
Codename:	buster
  • minimal example if possible
# tests.py
def test_01():
    pass
pytest --collect-only tests.py ""
============================================================================= test session starts =============================================================================
platform linux -- Python 3.7.3, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
rootdir: /home/mikko/sandbox/pytest
collected 2 items                                                                                                                                                             
<Module tests.py>
  <Function test_01>
<Module tests.py>
  <Function test_01>

============================================================================ no tests ran in 0.01s ============================================================================

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:19 (19 by maintainers)

github_iconTop GitHub Comments

1reaction
DahlitzFloriancommented, May 31, 2020

Sounds good. Today or tomorrow I will submit a PR addressing it.

0reactions
DahlitzFloriancommented, Jun 1, 2020

I guess, we need to check whether it was '' at the beginning and a path afterwards. This way, we can eliminate the test failures. I won’t have the time to look at it until the end of the week.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Working with custom markers — pytest documentation
Custom marker and command line option to control test runs¶ ... The --markers option always gives you a list of available markers: $...
Read more >
pytest Documentation - Read the Docs
“How to mark test functions with attributes” for information on the pytest.mark mechanism. • “Fixtures reference” for providing a functional ...
Read more >
Pytest not collecting tests with pytest command - Stack Overflow
On the command line, whether I am in Project or cd in to tests, when I run pytest , it outputs "collected 0...
Read more >
Welcome to Pytest-BDD's documentation! - Read the Docs
Functions decorated with the scenario decorator behave like a normal test function, and they will be executed after all scenario steps. from pytest_bdd...
Read more >
pytest-phmdoctest - PyPI
pytest plugin to test Python examples in Markdown using ... See below to generate and collect test files with a single pytest command....
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