From 7f85b222bf14ca809c26281942bf0bc902a70a93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micka=C3=ABl=20Schoentgen?= Date: Sat, 5 Jan 2019 22:46:06 +0100 Subject: [PATCH 1/2] Fix DeprecationWarning: invalid escape sequence in tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mickaƫl Schoentgen --- tests/integration/test_cli.py | 2 +- tests/unit/test_utils.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/integration/test_cli.py b/tests/integration/test_cli.py index a38883e0ed..23f1e43f08 100644 --- a/tests/integration/test_cli.py +++ b/tests/integration/test_cli.py @@ -207,7 +207,7 @@ def test_install_parse_error(PipenvInstance, pypi): [dev-packages] """.strip() f.write(contents) - c = p.pipenv('install requests u/\\/p@r\$34b13+pkg') + c = p.pipenv('install requests u/\\/p@r\\$34b13+pkg') assert c.return_code != 0 assert 'u/\\/p@r$34b13+pkg' not in p.pipfile['packages'] diff --git a/tests/unit/test_utils.py b/tests/unit/test_utils.py index aeaf3ed36f..34aa552b96 100644 --- a/tests/unit/test_utils.py +++ b/tests/unit/test_utils.py @@ -206,7 +206,7 @@ def mock_version(path): @pytest.mark.windows @pytest.mark.skipif(os.name != "nt", reason="Windows test only") def test_windows_shellquote(self): - test_path = "C:\Program Files\Python36\python.exe" + test_path = "C:\\Program Files\\Python36\\python.exe" expected_path = '"C:\\\\Program Files\\\\Python36\\\\python.exe"' assert pipenv.utils.escape_grouped_arguments(test_path) == expected_path From 5d4c7b1257b542db5bb36e375009630cfcfc7b78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micka=C3=ABl=20Schoentgen?= Date: Sat, 19 Jan 2019 15:31:05 +0100 Subject: [PATCH 2/2] Use raw strings --- tests/integration/test_cli.py | 2 +- tests/unit/test_utils.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/integration/test_cli.py b/tests/integration/test_cli.py index 23f1e43f08..d2c6d19498 100644 --- a/tests/integration/test_cli.py +++ b/tests/integration/test_cli.py @@ -207,7 +207,7 @@ def test_install_parse_error(PipenvInstance, pypi): [dev-packages] """.strip() f.write(contents) - c = p.pipenv('install requests u/\\/p@r\\$34b13+pkg') + c = p.pipenv(r'install requests u/\\/p@r\$34b13+pkg') assert c.return_code != 0 assert 'u/\\/p@r$34b13+pkg' not in p.pipfile['packages'] diff --git a/tests/unit/test_utils.py b/tests/unit/test_utils.py index 34aa552b96..43f9642bc8 100644 --- a/tests/unit/test_utils.py +++ b/tests/unit/test_utils.py @@ -206,7 +206,7 @@ def mock_version(path): @pytest.mark.windows @pytest.mark.skipif(os.name != "nt", reason="Windows test only") def test_windows_shellquote(self): - test_path = "C:\\Program Files\\Python36\\python.exe" + test_path = r"C:\Program Files\Python36\python.exe" expected_path = '"C:\\\\Program Files\\\\Python36\\\\python.exe"' assert pipenv.utils.escape_grouped_arguments(test_path) == expected_path