Skip to content

Commit add2ab1

Browse files
committed
Fix tests with newer Python (3.7.6, 3.8.1 and 3.9.0+).
1 parent be1251a commit add2ab1

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

CHANGES/409.bugfix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix tests with newer Python (3.7.6, 3.8.1 and 3.9.0+).

tests/test_url_parsing.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,15 @@ def test_scheme_only(self):
4040

4141
def test_no_scheme1(self):
4242
u = URL("google.com:80")
43-
assert u.scheme == ""
44-
assert u.host is None
45-
assert u.path == "google.com:80"
43+
# See: https://bugs.python.org/issue27657
44+
if sys.version_info[:3] == (3, 7, 6) or sys.version_info[:3] == (3, 8, 1) or sys.version_info >= (3, 9, 0):
45+
assert u.scheme == "google.com"
46+
assert u.host is None
47+
assert u.path == "80"
48+
else:
49+
assert u.scheme == ""
50+
assert u.host is None
51+
assert u.path == "google.com:80"
4652
assert u.query_string == ""
4753
assert u.fragment == ""
4854

0 commit comments

Comments
 (0)