-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Closed
Labels
topic: collectionrelated to the collection phaserelated to the collection phasetopic: parametrizerelated to @pytest.mark.parametrizerelated to @pytest.mark.parametrizetype: bugproblem that needs to be addressedproblem that needs to be addressed
Description
Problem
Parametrize values of type byte
don't properly escape non-printable characters leading to inability to select those specific tests with -k
.
Minimal example
test_select.py
:
import pytest
@pytest.mark.parametrize('p', [b'\x01a', b'b'])
def test_a(p):
pass
~$ pytest --collect-only --quiet
test_select.py::test_a[a]
test_select.py::test_a[b]
no tests ran in 0.04 seconds
~$ pytest -k 'test_a[a]'
======================================== test session starts ========================================
platform darwin -- Python 3.6.6, pytest-4.0.0, py-1.7.0, pluggy-0.8.0
rootdir: /Users/ulo/Envs/tmp-54dcc18e560d86f8/pytest-select, inifile:
collected 2 items / 2 deselected
=================================== 2 deselected in 0.01 seconds ====================================
Metadata
Metadata
Assignees
Labels
topic: collectionrelated to the collection phaserelated to the collection phasetopic: parametrizerelated to @pytest.mark.parametrizerelated to @pytest.mark.parametrizetype: bugproblem that needs to be addressedproblem that needs to be addressed