Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 3e572c9

Browse files
committed
Merge PR #822
2 parents 0fa265b + a1ffbdf commit 3e572c9

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

CHANGES/821.contrib.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
822.contrib.rst

CHANGES/822.contrib.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
A regression test for no-host URLs was added per :issue:`821`
2+
and :rfc:`3986` -- by :user:`kenballus`.

tests/test_url_parsing.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -214,9 +214,15 @@ def test_no_path(self):
214214
assert u.query_string == ""
215215
assert u.fragment == ""
216216

217+
@pytest.mark.xfail(reason="https://github.com/aio-libs/yarl/issues/821")
217218
def test_no_host(self):
218-
with pytest.raises(ValueError):
219-
URL("//:80")
219+
u = URL("//:80")
220+
assert u.scheme == ""
221+
assert u.host == ""
222+
assert u.port == 80
223+
assert u.path == "/"
224+
assert u.query_string == ""
225+
assert u.fragment == ""
220226

221227
def test_double_port(self):
222228
with pytest.raises(ValueError):

0 commit comments

Comments
 (0)