mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-04-29 10:10:19 +00:00
conftest: Skip functional tests if splinter not importable
Signed-off-by: James Valleroy <jvalleroy@mailbox.org> Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
This commit is contained in:
parent
b4e3824a4a
commit
4f79096d07
12
conftest.py
12
conftest.py
@ -11,6 +11,18 @@ from unittest.mock import patch
|
|||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
|
try:
|
||||||
|
importlib.import_module('splinter')
|
||||||
|
_splinter_available = True
|
||||||
|
except ImportError:
|
||||||
|
_splinter_available = False
|
||||||
|
|
||||||
|
|
||||||
|
def pytest_ignore_collect(path, config):
|
||||||
|
"""Ignore functional tests when splinter is not available."""
|
||||||
|
if path.basename == 'test_functional.py':
|
||||||
|
return not _splinter_available
|
||||||
|
|
||||||
|
|
||||||
def pytest_addoption(parser):
|
def pytest_addoption(parser):
|
||||||
"""Add a command line option to run functional tests."""
|
"""Add a command line option to run functional tests."""
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user