Properly escape \r \n \t bytes

This commit is contained in:
Anthony Sottile
2018-11-18 15:12:43 -08:00
parent 9a1e518cc3
commit 95c6d591f7
2 changed files with 6 additions and 1 deletions

View File

@@ -390,9 +390,11 @@ class TestMetafunc(object):
pytest.param("\x05", 2),
pytest.param(b"\x00", 3),
pytest.param(b"\x05", 4),
pytest.param("\t", 5),
pytest.param(b"\t", 6),
],
)
assert result == ["\\x00-1", "\\x05-2", "\\x00-3", "\\x05-4"]
assert result == ["\\x00-1", "\\x05-2", "\\x00-3", "\\x05-4", "\\t-5", "\\t-6"]
def test_idmaker_manual_ids_must_be_printable(self):
from _pytest.python import idmaker