Skip to content

Commit 6a5c196

Browse files
author
Sylvain MARIE
committed
1.2.1 Fixed id of test cases with marks
1 parent 10a3adb commit 6a5c196

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

docs/changelog.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
### 1.2.1 - fixed id of test cases with marks
4+
5+
Id of test cases with marks was appearing as `ParameterSet`. Fixed it.
6+
37
### 1.2.0 - @pytest.mark can be used on cases + @pytest_fixture_plus parametrization order bugfix
48

59
Pytest marks such as `@pytest.mark.skipif` can now be used on case functions. As a consequence, `get_all_cases` is now the recommended function to use instead of `extract_cases_from_module` to perform manual collection. Indeed `get_all_cases` correctly prepares the resulting parameters list so that pytest sees the marks. Fixed [#21](https://github.com/smarie/python-pytest-cases/issues/21)

pytest_cases/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -517,7 +517,7 @@ def datasets_decorator(test_func):
517517
try:
518518
_ = pytest.param
519519
def get_marked_parameter_for_case(c, marks):
520-
return pytest.param(c, marks=marks)
520+
return pytest.param(c, marks=marks, id=str(c))
521521
except AttributeError:
522522
def get_marked_parameter_for_case(c, marks):
523523
if len(marks) > 1:

0 commit comments

Comments
 (0)