mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-03-11 09:04:54 +00:00
tests: Don't error during collection if selenium is not installed
This fixes the current pipeline failures. Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org> Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
parent
485107604f
commit
f25e2706d2
@ -13,15 +13,16 @@ import pytest
|
||||
|
||||
try:
|
||||
importlib.import_module('splinter')
|
||||
_splinter_available = True
|
||||
importlib.import_module('selenium')
|
||||
_functional_libs_available = True
|
||||
except ImportError:
|
||||
_splinter_available = False
|
||||
_functional_libs_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
|
||||
return not _functional_libs_available
|
||||
|
||||
|
||||
def pytest_addoption(parser):
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user