Skip to content

Commit

Permalink
Safely handle test repeat option
Browse files Browse the repository at this point in the history
  • Loading branch information
philippjfr committed Sep 23, 2024
1 parent b60d1f6 commit 81ccf03
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions panel/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,9 @@ def pytest_configure(config):
config.addinivalue_line("markers", "internet: mark test as requiring an internet connection")

def pytest_generate_tests(metafunc):
if metafunc.config.option.repeat is not None:
count = int(metafunc.config.option.repeat)
repeat = getattr(metafunc.config.option, 'repeat', None)
if repeat is not None:
count = int(repeat)

# We're going to duplicate these tests by parametrizing them,
# which requires that each test has a fixture to accept the parameter.
Expand Down

0 comments on commit 81ccf03

Please sign in to comment.