diff --git a/testproject/testapp/tests/test_urls/test_urls.py b/testproject/testapp/tests/test_urls/test_urls.py index acf7e0f1..f048d0cf 100644 --- a/testproject/testapp/tests/test_urls/test_urls.py +++ b/testproject/testapp/tests/test_urls/test_urls.py @@ -1,5 +1,6 @@ import json import pathlib +from contextlib import suppress import pytest from deepdiff import DeepDiff @@ -42,11 +43,9 @@ def get_all_urls(patterns, prefix=""): "Function based views are not supported" ) # head is not present in the CI for some reason... - try: + with suppress(ValueError): i = allowed_methods.index("head") del allowed_methods[i] - except ValueError: - pass urls.append( {