-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Closed
Labels
good first issueeasy issue that is friendly to new contributoreasy issue that is friendly to new contributortype: bugproblem that needs to be addressedproblem that needs to be addressedtype: regressionindicates a problem that was introduced in a release which was working previouslyindicates a problem that was introduced in a release which was working previously
Description
The MarkDecorator __eq__
method assumes that it will always be compared with another mark. If you do large parametrizations based on lists, then you'll likely run into scenarios where this isn't the case (especially if you do combinations of lists).
Simple example:
import pytest
TEST_DATA = ['a', 'b', 'c', pytest.mark.xfail('d')]
SUBSET_TESTS = [x for x in TEST_DATA if x in ('a', 'b')]
@pytest.mark.parametrize('data', SUBSET_TESTS)
def test_me(data):
pass
You'll get an error on collection:
return self.mark == other.mark
E AttributeError: 'str' object has no attribute 'mark'
This affects sets, lists (including list.index
!), anything that checks for equality.
Metadata
Metadata
Assignees
Labels
good first issueeasy issue that is friendly to new contributoreasy issue that is friendly to new contributortype: bugproblem that needs to be addressedproblem that needs to be addressedtype: regressionindicates a problem that was introduced in a release which was working previouslyindicates a problem that was introduced in a release which was working previously