Skip to content

Commit

Permalink
Fix tests with newer Python (3.8.1+ and 2.7.15+)
Browse files Browse the repository at this point in the history
  • Loading branch information
onovy committed Dec 28, 2019
1 parent be1251a commit 2edc90a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGES/409.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix tests with newer Python (3.8.1+ and 2.7.15+).
12 changes: 9 additions & 3 deletions tests/test_url_parsing.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,15 @@ def test_scheme_only(self):

def test_no_scheme1(self):
u = URL("google.com:80")
assert u.scheme == ""
assert u.host is None
assert u.path == "google.com:80"
# See: https://bugs.python.org/issue27657
if sys.version_info >= (3, 8, 1) or sys.version_info >= (2, 7, 15):
assert u.scheme == "google.com"
assert u.host is None
assert u.path == "80"
else:
assert u.scheme == ""
assert u.host is None
assert u.path == "google.com:80"
assert u.query_string == ""
assert u.fragment == ""

Expand Down

0 comments on commit 2edc90a

Please sign in to comment.