-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Split up Windows tests relying on urlunparse behaviour (#12788)
There was a behavioural change to `urllib.parse.urlunparse`[1] that affects some of our tests on Windows. With the understanding that the new behaviour is indeed desired, split up some tests relying on this behaviour depending on the version of Python. The sample URL used to check this behaviour was taken from a test in the upstream change (with the new behaviour this URL will round-trip parsing) [1] python/cpython#113563
- Loading branch information
1 parent
00c75c4
commit 5c389ec
Showing
4 changed files
with
45 additions
and
13 deletions.
There are no files selected for viewing
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,7 +35,12 @@ | |
_ensure_quoted_url, | ||
) | ||
from pip._internal.network.session import PipSession | ||
from tests.lib import TestData, make_test_link_collector | ||
from tests.lib import ( | ||
TestData, | ||
make_test_link_collector, | ||
skip_needs_new_urlun_behavior_win, | ||
skip_needs_old_urlun_behavior_win, | ||
) | ||
|
||
ACCEPT = ", ".join( | ||
[ | ||
|
@@ -383,10 +388,12 @@ def test_clean_url_path_with_local_path(path: str, expected: str) -> None: | |
pytest.param( | ||
"file:///T:/path/with spaces/", | ||
"file:///T:/path/with%20spaces", | ||
marks=pytest.mark.skipif( | ||
"sys.platform != 'win32' or " | ||
"sys.version_info == (3, 13, 0, 'beta', 2)" | ||
), | ||
marks=skip_needs_old_urlun_behavior_win, | ||
), | ||
pytest.param( | ||
"file:///T:/path/with spaces/", | ||
"file://///T:/path/with%20spaces", | ||
marks=skip_needs_new_urlun_behavior_win, | ||
), | ||
# URL with Windows drive letter, running on non-windows | ||
# platform. The `:` after the drive should be quoted. | ||
|
@@ -399,10 +406,12 @@ def test_clean_url_path_with_local_path(path: str, expected: str) -> None: | |
pytest.param( | ||
"git+file:///T:/with space/[email protected]#egg=my-package-1.0", | ||
"git+file:///T:/with%20space/[email protected]#egg=my-package-1.0", | ||
marks=pytest.mark.skipif( | ||
"sys.platform != 'win32' or " | ||
"sys.version_info == (3, 13, 0, 'beta', 2)" | ||
), | ||
marks=skip_needs_old_urlun_behavior_win, | ||
), | ||
pytest.param( | ||
"git+file:///T:/with space/[email protected]#egg=my-package-1.0", | ||
"git+file://///T:/with%20space/[email protected]#egg=my-package-1.0", | ||
marks=skip_needs_new_urlun_behavior_win, | ||
), | ||
# Test a VCS URL with a Windows drive letter and revision, | ||
# running on non-windows platform. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters