diff --git a/conftest.py b/conftest.py index 425740dd..94953d0e 100644 --- a/conftest.py +++ b/conftest.py @@ -1,3 +1,5 @@ +import importlib + import pytest import cssutils @@ -9,6 +11,12 @@ ] +try: + importlib.import_module('lxml') +except ImportError: + collect_ignore += ['examples/style.py'] + + @pytest.fixture(autouse=True) def hermetic_profiles(): """ diff --git a/setup.cfg b/setup.cfg index 0fe623ef..f99e8474 100644 --- a/setup.cfg +++ b/setup.cfg @@ -52,7 +52,9 @@ testing = # local mock - lxml + lxml; \ + # workaround for #25 + python_version < "3.11" cssselect importlib_resources; python_version < "3.9"