Skip to content

Commit

Permalink
Tests: Adds pytest marker configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
ask committed Dec 20, 2019
1 parent eaf6c77 commit 1bac2dd
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 0 deletions.
19 changes: 19 additions & 0 deletions t/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -274,3 +274,22 @@ def tasks_not_lingering(request, loop, event_loop, _recorded_tasks_at_startup):
'Left over tasks',
os.environ.get('PYTEST_CURRENT_TEST'),
_compare_eq_set(tasks_now, tasks_then, verbose=2))


def pytest_configure(config):
config.addinivalue_line(
'markers',
'allow_lingering_tasks: Allow test to start background tasks',
)
config.addinivalue_line(
'markers',
'allow_lingering_tasks: Allow test to start background tasks',
)
config.addinivalue_line(
'markers',
'time: Set the current time',
)
config.addinivalue_line(
'markers',
'http_session: Set mock aiohttp session result',
)
9 changes: 9 additions & 0 deletions t/functional/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,3 +115,12 @@ def mocked_redis(*, event_loop, monkeypatch):
client_cls.storage = storage
monkeypatch.setattr('aredis.StrictRedis', client_cls)
return client_cls


def pytest_configure(config):
config.addinivalue_line(
'markers', 'app: App instance to use for tests',
)
config.addinivalue_line(
'markers', 'logging: Configure logging setup to use for tests',
)
6 changes: 6 additions & 0 deletions t/unit/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,9 @@ def app(event_loop, request):
@pytest.fixture()
def web(app):
return app.web


def pytest_configure(config):
config.addinivalue_line(
'markers', 'conf: Faust app configuration marker',
)

0 comments on commit 1bac2dd

Please sign in to comment.