Skip to content

Commit

Permalink
Add mechanism to not run tests that require an Internet connection
Browse files Browse the repository at this point in the history
  • Loading branch information
tacgomes committed Dec 5, 2024
1 parent f61e3dc commit c104a32
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -96,3 +96,7 @@ exclude_also = [
minversion = "6.0"
testpaths = ["tests"]
addopts = "--cov --no-header"
markers = [
"""network: mark a test that require an Internet \
connection (deselect with '-m "not network"')"""
]
2 changes: 2 additions & 0 deletions tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,7 @@ def test_default_verbosity(execute):
assert result.exit_code == EX_OK


@pytest.mark.network
@pytest.mark.skipif(
sys.version_info < (3, 13),
reason="Skipping test to avoid hitting API limits for Yahoo Finance",
Expand All @@ -282,6 +283,7 @@ def test_capital_gains_with_splits_downloaded_from_internet(execute):
assert result.exit_code == EX_OK


@pytest.mark.network
@pytest.mark.skipif(
sys.version_info < (3, 13),
reason="Skipping test to avoid hitting API limits for Yahoo Finance",
Expand Down

0 comments on commit c104a32

Please sign in to comment.