Skip to content

Quotation marks in pytest command collects duplicate tests #7012

Description

@mikraj01
  • 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 ============================================================================

No activity

Activity on this issue will appear here.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    topic: collectionrelated to the collection phasetype: bugproblem that needs to be addressed

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions