Skip to content

Commit

Permalink
tests: use hasattr rather than try except for request fixture
Browse files Browse the repository at this point in the history
  • Loading branch information
Eoghan O'Connell committed Jan 21, 2025
1 parent 5f92921 commit 32e71e1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ def pytest_configure(config):
@pytest.fixture
def hologram(request):
# if the user hasn't asked for parametrize, then set default
try:
if hasattr(request, "param"):
size = request.param
except AttributeError:
else:
size = 64
x = np.arange(size).reshape(-1, 1) - size / 2
y = np.arange(size).reshape(1, -1) - size / 2
Expand Down

0 comments on commit 32e71e1

Please sign in to comment.