Skip to content

Commit

Permalink
Avoid some pylint false-positives
Browse files Browse the repository at this point in the history
Pylint is confused by the crazy stuff that `h-matchers`'s "fluent
entrypoint" decorator does in order to enable `Any.list.containing(...)`
instead of having to write `Any.list().containing(...)`.
  • Loading branch information
seanh committed Jun 13, 2024
1 parent 96dd8c3 commit cca1fd3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions tests/unit/h_vialib/client_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ def test_url_for_allows_you_to_override_options(self, client, content_type):
override = {"via.client.openSidebar": "0"}
final_url = client.url_for("http://example.com", content_type, options=override)

assert final_url == Any.url.containing_query(override)
assert final_url == Any.url().containing_query(override)

def test_url_for_with_headers(self, client, Encryption):
headers = {"some": "header"}
Expand All @@ -121,7 +121,7 @@ def test_url_for_with_headers(self, client, Encryption):
final_url = client.url_for("http://example.com", headers=headers)

Encryption.return_value.encrypt_dict.assert_called_once_with(headers)
assert final_url == Any.url.containing_query(
assert final_url == Any.url().containing_query(
{"via.secret.headers": "secure headers"}
)

Expand All @@ -132,7 +132,7 @@ def test_url_for_with_query(self, client, Encryption):
final_url = client.url_for("http://example.com", query=query)

Encryption.return_value.encrypt_dict.assert_called_once_with(query)
assert final_url == Any.url.containing_query(
assert final_url == Any.url().containing_query(
{"via.secret.query": "secure query"}
)

Expand Down
4 changes: 2 additions & 2 deletions tests/unit/h_vialib/configuration_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,11 @@ def test_add_to_url(self):
)

# Original via settings are wiped
assert url_with_config != Any.url.containing_query({"via.client.focus": "3"})
assert url_with_config != Any.url().containing_query({"via.client.focus": "3"})

def assert_correct_params(self, via_params, client_params):
assert via_params == {"setting": "setting_last"}
assert client_params == Any.dict.containing({"focus": "focus_last"})
assert client_params == Any.dict().containing({"focus": "focus_last"})

@pytest.fixture
def url_with_params(self, query_string):
Expand Down

0 comments on commit cca1fd3

Please sign in to comment.