-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- setup pytest test folder and configs with just a dummy test for now
- Loading branch information
1 parent
211afa7
commit 5a88923
Showing
3 changed files
with
46 additions
and
0 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,30 @@ | ||
#!/usr/bin/env python | ||
# -*- coding: utf-8 -*- | ||
"""Pytest configuration.""" | ||
|
||
import pytest | ||
|
||
|
||
def pytest_addoption(parser): | ||
"""Adds --integration option to pytest.""" | ||
parser.addoption( | ||
"--integration", | ||
action="store_true", | ||
default=False, | ||
help="Run integration tests.", | ||
) | ||
|
||
|
||
def pytest_configure(config): | ||
"""Adds marker for slow.""" | ||
config.addinivalue_line("markers", "integration: mark test as an integration test") | ||
|
||
|
||
def pytest_collection_modifyitems(config, items): | ||
"""Skips tests marked slow if --integration isn't used.""" | ||
if config.getoption("--integration"): | ||
return | ||
skip_integration = pytest.mark.skip(reason="need --integration option to run") | ||
for item in items: | ||
if "integration" in item.keywords: | ||
item.add_marker(skip_integration) |
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 @@ | ||
"""Unit test package for fact-species-viz.""" |
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,15 @@ | ||
#!/usr/bin/env python | ||
|
||
"""Tests for `fact_species_viz` package.""" | ||
|
||
import pytest | ||
|
||
|
||
@pytest.fixture | ||
def example_data() -> str: | ||
return "hi" | ||
|
||
|
||
def test_content(example_data): | ||
"""Sample pytest test function with the pytest fixture as an argument.""" | ||
assert example_data == "hi" |