mirror of
https://github.com/onyx-and-iris/voicemeeter-api-python.git
synced 2025-01-31 15:20:46 +00:00
rename test poe scripts
add passenv = * to [testenv]
This commit is contained in:
parent
328bea347c
commit
b79d9494a2
@ -37,10 +37,10 @@ levels.script = "scripts:ex_levels"
|
|||||||
midi.script = "scripts:ex_midi"
|
midi.script = "scripts:ex_midi"
|
||||||
obs.script = "scripts:ex_obs"
|
obs.script = "scripts:ex_obs"
|
||||||
observer.script = "scripts:ex_observer"
|
observer.script = "scripts:ex_observer"
|
||||||
basic.script = "scripts:test_basic"
|
test_basic.script = "scripts:test_basic"
|
||||||
banana.script = "scripts:test_banana"
|
test_banana.script = "scripts:test_banana"
|
||||||
potato.script = "scripts:test_potato"
|
test_potato.script = "scripts:test_potato"
|
||||||
all.script = "scripts:test_all"
|
test_all.script = "scripts:test_all"
|
||||||
|
|
||||||
[tool.tox]
|
[tool.tox]
|
||||||
legacy_tox_ini = """
|
legacy_tox_ini = """
|
||||||
@ -48,6 +48,7 @@ legacy_tox_ini = """
|
|||||||
envlist = py310,py311,py312
|
envlist = py310,py311,py312
|
||||||
|
|
||||||
[testenv]
|
[testenv]
|
||||||
|
passenv = *
|
||||||
setenv = VIRTUALENV_DISCOVERY=pyenv
|
setenv = VIRTUALENV_DISCOVERY=pyenv
|
||||||
allowlist_externals = poetry
|
allowlist_externals = poetry
|
||||||
commands =
|
commands =
|
||||||
@ -105,14 +106,16 @@ target-version = "py310"
|
|||||||
|
|
||||||
[tool.ruff.lint]
|
[tool.ruff.lint]
|
||||||
# Enable Pyflakes (`F`) and a subset of the pycodestyle (`E`) codes by default.
|
# Enable Pyflakes (`F`) and a subset of the pycodestyle (`E`) codes by default.
|
||||||
|
# Enable flake8-errmsg (EM) warnings.
|
||||||
|
# Enable flake8-bugbear (B) warnings.
|
||||||
# Unlike Flake8, Ruff doesn't enable pycodestyle warnings (`W`) or
|
# Unlike Flake8, Ruff doesn't enable pycodestyle warnings (`W`) or
|
||||||
# McCabe complexity (`C901`) by default.
|
# McCabe complexity (`C901`) by default.
|
||||||
select = ["E4", "E7", "E9", "F"]
|
select = ["E4", "E7", "E9", "EM", "F", "B"]
|
||||||
ignore = []
|
ignore = []
|
||||||
|
|
||||||
# Allow fix for all enabled rules (when `--fix`) is provided.
|
# Allow fix for all enabled rules (when `--fix`) is provided.
|
||||||
fixable = ["ALL"]
|
fixable = ["ALL"]
|
||||||
unfixable = []
|
unfixable = ["B"]
|
||||||
|
|
||||||
# Allow unused variables when underscore-prefixed.
|
# Allow unused variables when underscore-prefixed.
|
||||||
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
|
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
|
||||||
|
@ -38,18 +38,15 @@ def ex_observer():
|
|||||||
|
|
||||||
|
|
||||||
def test_basic():
|
def test_basic():
|
||||||
os.environ['KIND'] = 'basic'
|
subprocess.run(['tox'], env=os.environ.copy() | {'KIND': 'basic'})
|
||||||
subprocess.run(['tox'])
|
|
||||||
|
|
||||||
|
|
||||||
def test_banana():
|
def test_banana():
|
||||||
os.environ['KIND'] = 'banana'
|
subprocess.run(['tox'], env=os.environ.copy() | {'KIND': 'banana'})
|
||||||
subprocess.run(['tox'])
|
|
||||||
|
|
||||||
|
|
||||||
def test_potato():
|
def test_potato():
|
||||||
os.environ['KIND'] = 'potato'
|
subprocess.run(['tox'], env=os.environ.copy() | {'KIND': 'potato'})
|
||||||
subprocess.run(['tox'])
|
|
||||||
|
|
||||||
|
|
||||||
def test_all():
|
def test_all():
|
||||||
|
@ -31,10 +31,8 @@ class Data:
|
|||||||
return (2 * self.phys_in) + (8 * self.virt_in)
|
return (2 * self.phys_in) + (8 * self.virt_in)
|
||||||
|
|
||||||
|
|
||||||
# get KIND_ID from env var, otherwise set to random
|
# get KIND from environment, if not set default to potato
|
||||||
KIND_ID = os.environ.get(
|
KIND_ID = os.environ.get('KIND', 'potato')
|
||||||
"KIND", random.choice(tuple(kind_id.name.lower() for kind_id in KindId))
|
|
||||||
)
|
|
||||||
vm = voicemeeterlib.api(KIND_ID)
|
vm = voicemeeterlib.api(KIND_ID)
|
||||||
kind = kindmap(KIND_ID)
|
kind = kindmap(KIND_ID)
|
||||||
|
|
||||||
@ -56,7 +54,7 @@ data = Data(
|
|||||||
|
|
||||||
|
|
||||||
def setup_module():
|
def setup_module():
|
||||||
print(f"\nRunning tests for kind [{data.name}]\n", file=sys.stdout)
|
print(f'\nRunning tests for kind [{data.name}]\n', file=sys.stdout)
|
||||||
vm.login()
|
vm.login()
|
||||||
vm.command.reset()
|
vm.command.reset()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user