Skip to content

exclude function excludes the wrong function + not working if only 2 testcases in testrun #10

@Stefanhg

Description

@Stefanhg

Hello,
I have been testing this plugin and I found some weird behavior.
If using the example included and modifying it so it prints the name of each testcase test_login and test_failed_login is selected and test_change_password is deselected.

If you uncomment test_change_password it breaks completely and both tests are executed.

Command executed: pytest test.py --tags user 'not failure' -s

Testcases:

 import pytest

pytestmark = pytest.mark.tags("login")

@pytest.mark.tags("not firefox", "user")
def test_login():
    print("test_login")

@pytest.mark.tags("failure", "user")
def test_failed_login():
    print("test_failed_login")

@pytest.mark.tags("password")
def test_change_password():
    print("test_change_password")

Output:

================================================= test session starts =================================================
platform win32 -- Python 3.10.6, pytest-7.4.0, pluggy-1.0.0
tags: user, 'not, failure'
rootdir: D:\Test\tester
plugins: devpi-server-6.9.0, html-3.2.0, metadata-3.0.0, subtests-0.11.0, tags-1.8.1
collecting ...  ['user', 'login', 'not firefox']
        ['user', 'login', 'failure']
        ['login', 'password']
collected 3 items / 1 deselected / 2 selected
selected 2 items

test.py test_login
.test_failed_login
.

=========================================== 2 passed, 1 deselected in 0.01s ===========================================

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions