diff --git a/acme/acme/_internal/tests/jws_test.py b/acme/acme/_internal/tests/jws_test.py index 016904652..222552cf4 100644 --- a/acme/acme/_internal/tests/jws_test.py +++ b/acme/acme/_internal/tests/jws_test.py @@ -21,7 +21,7 @@ class HeaderTest(unittest.TestCase): except (ValueError, TypeError): assert True else: - assert False # pragma: no cover + pytest.fail("Exception from jose.b64decode wasn't raised") # pragma: no cover def test_nonce_decoder(self): from acme.jws import Header diff --git a/certbot/certbot/_internal/tests/main_test.py b/certbot/certbot/_internal/tests/main_test.py index fa7d1b636..ec3c7dec2 100644 --- a/certbot/certbot/_internal/tests/main_test.py +++ b/certbot/certbot/_internal/tests/main_test.py @@ -1327,7 +1327,7 @@ class MainTest(test_util.ConfigTestCase): def test_certonly_bad_args(self): try: self._call(['-a', 'bad_auth', 'certonly']) - assert False, "Exception should have been raised" + pytest.fail("Exception should have been raised") except errors.PluginSelectionError as e: assert 'The requested bad_auth plugin does not appear' in str(e) @@ -1356,7 +1356,7 @@ class MainTest(test_util.ConfigTestCase): except errors.Error as e: assert "Please try the certonly" in repr(e) return - assert False, "Expected supplying --csr to fail with default verb" + pytest.fail("Expected supplying --csr to fail with default verb") def test_csr_with_no_domains(self): with pytest.raises(errors.Error):