-
Notifications
You must be signed in to change notification settings - Fork 310
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
64bfe16
commit a739641
Showing
3 changed files
with
32 additions
and
29 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
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 |
---|---|---|
@@ -1,31 +1,3 @@ | ||
import pytest | ||
|
||
pytest_plugins = [ | ||
"jupyter_server.pytest_plugin" | ||
] | ||
|
||
def pytest_addoption(parser): | ||
parser.addoption( | ||
"--integration_tests", | ||
default=False, | ||
type=bool, | ||
help="only run tests with the 'integration_test' pytest mark.", | ||
) | ||
|
||
|
||
def pytest_configure(config): | ||
# register an additional marker | ||
config.addinivalue_line( | ||
"markers", "integration_test" | ||
) | ||
|
||
|
||
def pytest_runtest_setup(item): | ||
is_integration_test = any([mark for mark in item.iter_markers(name="integration_test")]) | ||
|
||
if item.config.getoption("--integration_tests") is True: | ||
if not is_integration_test: | ||
pytest.skip("Only running tests marked as 'integration_test'.") | ||
else: | ||
if is_integration_test: | ||
pytest.skip("Skipping this test because it's marked 'integration_test'. Run integration tests using the `--integration_tests` flag.") |
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,27 @@ | ||
import pytest | ||
|
||
def pytest_addoption(parser): | ||
parser.addoption( | ||
"--integration_tests", | ||
default=False, | ||
type=bool, | ||
help="only run tests with the 'integration_test' pytest mark.", | ||
) | ||
|
||
|
||
def pytest_configure(config): | ||
# register an additional marker | ||
config.addinivalue_line( | ||
"markers", "integration_test" | ||
) | ||
|
||
|
||
def pytest_runtest_setup(item): | ||
is_integration_test = any([mark for mark in item.iter_markers(name="integration_test")]) | ||
|
||
if item.config.getoption("--integration_tests") is True: | ||
if not is_integration_test: | ||
pytest.skip("Only running tests marked as 'integration_test'.") | ||
else: | ||
if is_integration_test: | ||
pytest.skip("Skipping this test because it's marked 'integration_test'. Run integration tests using the `--integration_tests` flag.") |