Skip to content

Commit

Permalink
Extend pytest's markexpr conf in case it already exists
Browse files Browse the repository at this point in the history
  • Loading branch information
humitos committed Jun 28, 2018
1 parent 33813b5 commit 16728be
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,12 @@ def pytest_addoption(parser):
def pytest_configure(config):
if not config.option.searchtests:
# Include ``not search``` to parameters so search tests do not perform
setattr(config.option, 'markexpr', 'not search')
markexpr = getattr(config.option, 'markexpr')
if markexpr is not None:
markexpr += ' and not search'
else:
markexpr = 'not search'
setattr(config.option, 'markexpr', markexpr.strip())

for option, value in PYTEST_OPTIONS:
setattr(config.option, option, value)
Expand Down

0 comments on commit 16728be

Please sign in to comment.