introduce tox support

This commit is contained in:
Dusk Banks 2022-02-22 13:01:27 -08:00
parent a62866a2d3
commit 7cf3b06c7c
3 changed files with 32 additions and 1 deletions

1
.gitignore vendored
View file

@ -8,4 +8,5 @@ __pycache__/
*.pyo
.travis.pub
.pytest_cache/
.tox/
keyfile.toml

View file

@ -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}
"""

View file

@ -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", {