Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7079 from vidartf/commands-options
Commands options
- Loading branch information
Showing
10 changed files
with
394 additions
and
237 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
# Copyright (c) Jupyter Development Team. | ||
# Distributed under the terms of the Modified BSD License. | ||
|
||
import pytest | ||
|
||
def pytest_addoption(parser): | ||
""" | ||
Adds flags for py.test. | ||
This is called by the pytest API | ||
""" | ||
group = parser.getgroup("general") | ||
group.addoption('--quick', action='store_true', | ||
help="Skip slow tests") | ||
group.addoption('--slow', action='store_true', | ||
help="Run only slow tests") | ||
|
||
|
||
def pytest_configure(config): | ||
config.addinivalue_line("markers", "slow: mark test as slow to run") | ||
|
||
|
||
def pytest_collection_modifyitems(config, items): | ||
if config.getoption("--quick"): | ||
skip_slow = pytest.mark.skip(reason="skipping slow test") | ||
for item in items: | ||
if "slow" in item.keywords: | ||
item.add_marker(skip_slow) | ||
elif config.getoption("--slow"): | ||
skip_quick = pytest.mark.skip(reason="skipping non-slow test") | ||
for item in items: | ||
if "slow" not in item.keywords: | ||
item.add_marker(skip_quick) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.