Skip to content

In pytest >= 4.1 marks do not translate into keywords #4649

@kondratyev-nv

Description

@kondratyev-nv

This issue might be more of a question, but I would like to be sure if this is expected behaviour.

Running the following test

import pytest

@pytest.mark.foo
def test_mark():
    pass

with pytest >= 4.0 and -k foo succeeds

$ pytest -k foo
================================= test session starts =================================
platform linux2 -- Python 2.7.15rc1, pytest-4.0.2, py-1.7.0, pluggy-0.8.1
rootdir: /home/.../pytest_mark_sample, inifile:
collected 1 item                                                                      

test_mark.py .                                                                  [100%]

============================== 1 passed in 0.01 seconds ===============================

but the similar execution with pytest >= 4.1 fails

$ pytest -k foo
================================= test session starts =================================
platform linux2 -- Python 2.7.15rc1, pytest-4.1.1, py-1.7.0, pluggy-0.8.1
rootdir: /home/.../pytest_mark_sample, inifile:
collected 1 item / 1 deselected                                                       

============================ 1 deselected in 0.00 seconds =============================

When -k is replaced with -m both versions works fine.

It looks like this might be related to #4564 and #4569.

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: bugproblem that needs to be addressedtype: regressionindicates a problem that was introduced in a release which was working previously

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions