Skip to content

Commit

Permalink
Merge PR #822
Browse files Browse the repository at this point in the history
  • Loading branch information
webknjaz committed Nov 19, 2023
2 parents 0fa265b + a1ffbdf commit 3e572c9
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGES/821.contrib.rst
2 changes: 2 additions & 0 deletions CHANGES/822.contrib.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
A regression test for no-host URLs was added per :issue:`821`
and :rfc:`3986` -- by :user:`kenballus`.
10 changes: 8 additions & 2 deletions tests/test_url_parsing.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,9 +214,15 @@ def test_no_path(self):
assert u.query_string == ""
assert u.fragment == ""

@pytest.mark.xfail(reason="https://github.com/aio-libs/yarl/issues/821")
def test_no_host(self):
with pytest.raises(ValueError):
URL("//:80")
u = URL("//:80")
assert u.scheme == ""
assert u.host == ""
assert u.port == 80
assert u.path == "/"
assert u.query_string == ""
assert u.fragment == ""

def test_double_port(self):
with pytest.raises(ValueError):
Expand Down

0 comments on commit 3e572c9

Please sign in to comment.