Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import os

import pytest

REQUIRED_SECRETS = "RUN_TESTS_WITH_SECRETS"


def pytest_collection_modifyitems(config, items):
if os.getenv(REQUIRED_SECRETS):
return

skip_marker = pytest.mark.skip(
reason=f"Excluding tests with secrets (no : {REQUIRED_SECRETS} found)"
)

for item in items:
if "secrets" in item.keywords:
item.add_marker(skip_marker)
4 changes: 4 additions & 0 deletions tests/test_dropbox_.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
import pytest

from pauperformance_bot.service.pauperformance.storage.dropbox_ import DropboxService


@pytest.mark.secrets
def test_list_imported_youtube_videos():
assert any(
"Pauperformance" in v for v in DropboxService().list_imported_youtube_videos()
)


@pytest.mark.secrets
def test_list_imported_mtggoldfish_deck_names():
assert any(
"Jund" in d for d in DropboxService().list_imported_mtggoldfish_deck_names()
Expand Down
2 changes: 2 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ commands =
python setup.py sdist

[pytest]
markers =
secrets: tests that require secrets
addopts =
--cov pauperformance_bot
--cov pauperformance_bot
Expand Down