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/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", { diff --git a/tox.ini b/tox.ini new file mode 100644 index 0000000..b640e05 --- /dev/null +++ b/tox.ini @@ -0,0 +1,16 @@ +[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}