introduce tox support

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

1
.gitignore vendored
View File

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

View File

@ -3,7 +3,17 @@
import pytest 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): async def test_xpath_ok(get_version):
assert await get_version("unifiedremote", { assert await get_version("unifiedremote", {

16
tox.ini Normal file
View File

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