mirror of
https://github.com/onyx-and-iris/xair-api-python.git
synced 2025-02-22 11:55:07 +00:00
add py13 to tox envlist
test_xair and test_x32 now run tests with tox upd Tests section in README
This commit is contained in:
parent
cf4a1d295f
commit
2b91863337
2
.gitignore
vendored
2
.gitignore
vendored
@ -131,5 +131,7 @@ dmypy.json
|
||||
# config, quick test
|
||||
config.toml
|
||||
quick.py
|
||||
tools/*
|
||||
!tools/README.md
|
||||
|
||||
.vscode/
|
12
README.md
12
README.md
@ -339,14 +339,14 @@ print(mixer.query('/ch/01/mix/on'))
|
||||
|
||||
### `Tests`
|
||||
|
||||
Unplug any expensive equipment before running tests.
|
||||
Save your current settings to a snapshot first.
|
||||
Install [poetry](https://python-poetry.org/docs/#installation) and then:
|
||||
|
||||
First make sure you installed the [development dependencies](https://github.com/onyx-and-iris/xair-api-python#installation)
|
||||
```powershell
|
||||
poetry poe test-xair
|
||||
poetry poe test-x32
|
||||
```
|
||||
|
||||
To run all tests:
|
||||
|
||||
`pytest -v`.
|
||||
Unplug any expensive equipment and save your current settings to a snapshot first.
|
||||
|
||||
## License
|
||||
|
||||
|
@ -31,29 +31,33 @@ build-backend = "poetry.core.masonry.api"
|
||||
obs.script = "scripts:ex_obs"
|
||||
sends.script = "scripts:ex_sends"
|
||||
headamp.script = "scripts:ex_headamp"
|
||||
xair.script = "scripts:test_xair"
|
||||
x32.script = "scripts:test_x32"
|
||||
all.script = "scripts:test_all"
|
||||
test-xair.script = "scripts:test_xair"
|
||||
test-x32.script = "scripts:test_x32"
|
||||
test-all.script = "scripts:test_all"
|
||||
|
||||
[tool.tox]
|
||||
legacy_tox_ini = """
|
||||
[tox]
|
||||
envlist = py310,py311,py312
|
||||
[tox]
|
||||
envlist = py310,py311,py312,py313
|
||||
|
||||
[testenv]
|
||||
setenv = VIRTUALENV_DISCOVERY=pyenv
|
||||
allowlist_externals = poetry
|
||||
commands =
|
||||
poetry install -v
|
||||
poetry run pytest tests/
|
||||
[testenv]
|
||||
passenv =
|
||||
TEST_MODULE
|
||||
setenv = VIRTUALENV_DISCOVERY=pyenv
|
||||
allowlist_externals = poetry
|
||||
commands_pre =
|
||||
poetry install --no-interaction --no-root
|
||||
commands =
|
||||
poetry run pytest tests/{env:TEST_MODULE}
|
||||
|
||||
[testenv:obs]
|
||||
setenv = VIRTUALENV_DISCOVERY=pyenv
|
||||
allowlist_externals = poetry
|
||||
deps = obsws-python
|
||||
commands =
|
||||
poetry install -v --without dev
|
||||
poetry run python examples/xair_obs/
|
||||
[testenv:obs]
|
||||
setenv = VIRTUALENV_DISCOVERY=pyenv
|
||||
allowlist_externals = poetry
|
||||
deps = obsws-python
|
||||
commands_pre =
|
||||
poetry install --no-interaction --no-root --without dev
|
||||
commands =
|
||||
poetry run python examples/xair_obs
|
||||
"""
|
||||
|
||||
[tool.ruff]
|
||||
|
20
scripts.py
20
scripts.py
@ -1,31 +1,35 @@
|
||||
import os
|
||||
import subprocess
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
def ex_obs():
|
||||
subprocess.run(["tox", "r", "-e", "obs"])
|
||||
subprocess.run(['tox', 'r', '-e', 'obs'])
|
||||
|
||||
|
||||
def ex_sends():
|
||||
path = Path.cwd() / "examples" / "sends" / "."
|
||||
path = Path.cwd() / 'examples' / 'sends' / '.'
|
||||
subprocess.run([sys.executable, str(path)])
|
||||
|
||||
|
||||
def ex_headamp():
|
||||
path = Path.cwd() / "examples" / "headamp" / "."
|
||||
path = Path.cwd() / 'examples' / 'headamp' / '.'
|
||||
subprocess.run([sys.executable, str(path)])
|
||||
|
||||
|
||||
def test_xair():
|
||||
path = Path.cwd() / "tests" / "xair"
|
||||
subprocess.run(["pytest", "-v", str(path)])
|
||||
subprocess.run(['tox'], env=os.environ.copy() | {'TEST_MODULE': 'xair'})
|
||||
|
||||
|
||||
def test_x32():
|
||||
path = Path.cwd() / "tests" / "x32"
|
||||
subprocess.run(["pytest", "-v", str(path)])
|
||||
path = Path.cwd() / 'tools' / 'x32.exe'
|
||||
proc = subprocess.Popen([str(path), '-i', 'x32.local'])
|
||||
subprocess.run(['tox'], env=os.environ.copy() | {'TEST_MODULE': 'x32'})
|
||||
proc.terminate()
|
||||
|
||||
|
||||
def test_all():
|
||||
subprocess.run(["tox"])
|
||||
steps = [test_xair, test_x32]
|
||||
for step in steps:
|
||||
step()
|
||||
|
3
tools/README.md
Normal file
3
tools/README.md
Normal file
@ -0,0 +1,3 @@
|
||||
# X32 Tests
|
||||
|
||||
Download the [x32 Emulator](https://sites.google.com/site/patrickmaillot/x32#h.p_rE4IH0Luimc0) and place it in this directory in order to run the x32 tests.
|
Loading…
Reference in New Issue
Block a user