From 7f75fdd1c0960424fd15502e31821448cd9aaa23 Mon Sep 17 00:00:00 2001 From: Chris Meyers Date: Wed, 20 Nov 2024 13:53:29 -0500 Subject: [PATCH] Make tests more pleasant --- .../_temporary_private_credential_api_test.py | 24 +++++++++++++------ 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/tests/_temporary_private_credential_api_test.py b/tests/_temporary_private_credential_api_test.py index 0998816f..78c72fc7 100644 --- a/tests/_temporary_private_credential_api_test.py +++ b/tests/_temporary_private_credential_api_test.py @@ -1,4 +1,4 @@ -"""Tests for the temporarily hosted private helpers.""" +"""Tests for the temporarily hosted private credential structure.""" import pytest @@ -16,8 +16,8 @@ def test_credential_instantiation() -> None: @pytest.mark.parametrize( ('inputs', 'key', 'expected'), ( - ({'foo': 'bar'}, 'foo', 'bar'), - ({'foo1': 'bar1'}, 'baz', None), + pytest.param({'foo': 'bar'}, 'foo', 'bar', id='key-present'), + pytest.param({'foo1': 'bar1'}, 'baz', None, id='key-missing'), ), ) def test_credential_get_input( @@ -26,14 +26,24 @@ def test_credential_get_input( expected: str, ) -> None: """Check that get_input operates on the dict we provided.""" - assert Credential(inputs=inputs).get_input(key) == expected + assert Credential(inputs=inputs).get_input(key) is expected @pytest.mark.parametrize( ('inputs', 'key', 'expected'), ( - ({'foo2': 'bar2'}, 'foo2', True), - ({'foo3': 'bar3'}, 'baz', False), + pytest.param( + {'foo2': 'bar2'}, + 'foo2', + True, # noqa: WPS425 + id='key-present', + ), + pytest.param( + {'foo3': 'bar3'}, + 'baz', + False, # noqa: WPS425 + id='key-missing', + ), ), ) def test_credential_has_input( @@ -42,4 +52,4 @@ def test_credential_has_input( expected: bool, ) -> None: """Check that has_input behaves like dict in operator.""" - assert Credential(inputs=inputs).has_input(key) == expected + assert Credential(inputs=inputs).has_input(key) is expected