Skip to content
Myr

Don't use raw string when creating file

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Taylor Payne · committed by Taylor Payne · parent 67cefe7 · Browse files · 1 file+2 added−7 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+2 added−7 removed

  • tests:+2 added−7 removed

1 file+2 added−7 removed

modified:tests/test_types.py+2 added-7 removed
1import os.path2import pathlib3import platform3import tempfile45import pytest6
226 unmodified lines
233 message = FileError(filename="\udcff").format_message()234 assert message == "Could not open file '�': unknown error"235236238@pytest.mark.skipif(239 platform.system() == "Windows", reason="Filepath syntax differences."240)237def test_invalid_path_with_esc_sequence():238 with pytest.raises(click.BadParameter) as exc_info:243 with tempfile.TemporaryDirectory(prefix=r"my\ndir") as tempdir:239 with tempfile.TemporaryDirectory(prefix="my\ndir") as tempdir:240 click.Path(dir_okay=False).convert(tempdir, None, None)241246 expected = "my\\\\ndir"247 assert expected in exc_info.value.message242 assert "my\\ndir" in exc_info.value.message