strange handling of test ids for parametrize
See original GitHub issue$ cat tests/test_toast.py
import pytest
@pytest.mark.parametrize(
"ham,spam",
[
("/bacon/../", u"//bacon/../"),
("/bacon/../../", u"//bacon/../../"),
("/bacon//", u"//bacon//"),
],
)
def test_eggs(ham,spam):
pass
$ pytest -vvv tests/test_eggs.py
==================================== test session starts ====================================
platform linux -- Python 3.7.5, pytest-5.3.2, py-1.8.0, pluggy-0.12.0 -- /home/graingert/.virtualenvs/pytest/bin/python3.7
cachedir: .pytest_cache
rootdir: /home/graingert/projects/sausage/tests, inifile: pytest.ini
collected 3 items
tests/test_toast.py::test_eggs[/-/] PASSED [ 33%]
tests/] PASSED [ 66%]
tests/test_toast.py::test_eggs[/bacon/-/bacon/] PASSED [100%]
===================================== 3 passed in 0.01s =====================================
- a detailed description of the bug or suggestion
- output of
pip list
from the virtual environment you are using - pytest and operating system versions
- minimal example if possible
Issue Analytics
- State:
- Created 4 years ago
- Comments:9 (9 by maintainers)
Top Results From Across the Web
ids for fixtures and parametrize - pytest-tricks
The following test is parametrized and the id for a test item will be a representation for each individual parameter - joined with...
Read more >Parameterization – Load Testing with LoadRunner Tutorial #6
This LoadRunner VuGen Parameterization Tutorial will help you to learn ... Examples are session ids/tokens, session states, date values etc.
Read more >Parametrizing tests — pytest documentation
pytest will build a string that is the test ID for each set of values in a parametrized test. These IDs can be...
Read more >5 Pytest Best Practices for Writing Great Python Tests
Parametrizing tests and fixtures allows us to generate multiple copies of them easily. ... Use ids to describe individual test cases.
Read more >pytest Documentation - Read the Docs
How to parametrize fixtures and test functions . ... More info on temporary directory handling is available at Temporary directories and ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@blueyed reproduction as xfail test here: https://github.com/pytest-dev/pytest/pull/6394
I can reproduce it after
touch tests/pytest.ini
/touch t/pytest.ini
… 👍