Add return type to tests without arguments (#87613)

* Add return type to tests without arguments

* Black

* Cancel fixture amends
This commit is contained in:
epenet 2023-02-07 14:20:06 +01:00 committed by GitHub
parent fb4c0b4b7a
commit 4142f0d15d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
99 changed files with 473 additions and 459 deletions

View file

@ -23,7 +23,7 @@ def mock_session():
yield mocker
def test_client_id_scheme():
def test_client_id_scheme() -> None:
"""Test we enforce valid scheme."""
assert indieauth._parse_client_id("http://ex.com/")
assert indieauth._parse_client_id("https://ex.com/")
@ -32,7 +32,7 @@ def test_client_id_scheme():
indieauth._parse_client_id("ftp://ex.com")
def test_client_id_path():
def test_client_id_path() -> None:
"""Test we enforce valid path."""
assert indieauth._parse_client_id("http://ex.com").path == "/"
assert indieauth._parse_client_id("http://ex.com/hello").path == "/hello"
@ -54,13 +54,13 @@ def test_client_id_path():
indieauth._parse_client_id("http://ex.com/hello/../yo")
def test_client_id_fragment():
def test_client_id_fragment() -> None:
"""Test we enforce valid fragment."""
with pytest.raises(ValueError):
indieauth._parse_client_id("http://ex.com/#yoo")
def test_client_id_user_pass():
def test_client_id_user_pass() -> None:
"""Test we enforce valid username/password."""
with pytest.raises(ValueError):
indieauth._parse_client_id("http://user@ex.com/")
@ -69,7 +69,7 @@ def test_client_id_user_pass():
indieauth._parse_client_id("http://user:pass@ex.com/")
def test_client_id_hostname():
def test_client_id_hostname() -> None:
"""Test we enforce valid hostname."""
assert indieauth._parse_client_id("http://www.home-assistant.io/")
assert indieauth._parse_client_id("http://[::1]")
@ -91,7 +91,7 @@ def test_client_id_hostname():
assert indieauth._parse_client_id("http://192.167.0.0/")
def test_parse_url_lowercase_host():
def test_parse_url_lowercase_host() -> None:
"""Test we update empty paths."""
assert indieauth._parse_url("http://ex.com/hello").path == "/hello"
assert indieauth._parse_url("http://EX.COM/hello").hostname == "ex.com"
@ -101,7 +101,7 @@ def test_parse_url_lowercase_host():
assert parts.path == "/HELLO"
def test_parse_url_path():
def test_parse_url_path() -> None:
"""Test we update empty paths."""
assert indieauth._parse_url("http://ex.com").path == "/"