diff --git a/.gitignore b/.gitignore index b841bb7..4857e9f 100644 --- a/.gitignore +++ b/.gitignore @@ -8,4 +8,5 @@ __pycache__/ *.pyo .travis.pub .pytest_cache/ +.tox/ keyfile.toml diff --git a/pyproject.toml b/pyproject.toml index aa7f987..3f7a142 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,3 +4,23 @@ build-backend = "setuptools.build_meta" [tool.pytest.ini_options] # addopts = -n auto + +[tool.tox] +legacy_tox_ini = """ +[tox] +isolated_build = True +# you may find `tox --skip-missing-interpreters=true` helpful. +envlist = py3{7,8,9,10} + +[testenv] +usedevelop = false +deps = + pytest + pytest-asyncio + pytest-httpbin + flaky +extras = + htmlparser +passenv = KEYFILE +commands = pytest -r fEs {posargs} +""" diff --git a/tests/test_htmlparser.py b/tests/test_htmlparser.py index f3be52b..79ccd7e 100644 --- a/tests/test_htmlparser.py +++ b/tests/test_htmlparser.py @@ -3,7 +3,17 @@ import pytest -pytestmark = [pytest.mark.asyncio, pytest.mark.needs_net] +lxml_available = True +try: + import lxml +except ImportError: + lxml_available = False + +pytestmark = [ + pytest.mark.asyncio, + pytest.mark.needs_net, + pytest.mark.skipif(not lxml_available, reason="needs lxml"), +] async def test_xpath_ok(get_version): assert await get_version("unifiedremote", {