diff --git a/README.md b/README.md index a998469..72cb6b2 100644 --- a/README.md +++ b/README.md @@ -869,10 +869,12 @@ with voicemeeterlib.api('banana') as vm: ### Run tests -To run all tests: +Install [poetry](https://python-poetry.org/docs/#installation) and then: -``` -pytest -v +```powershell +poetry poe test-basic +poetry poe test-banana +poetry poe test-potato ``` ### Official Documentation diff --git a/poetry.lock b/poetry.lock index f1dd0a1..a6aa1d6 100644 --- a/poetry.lock +++ b/poetry.lock @@ -172,14 +172,14 @@ testing = ["covdefaults (>=2.3)", "pytest (>=8.3.3)", "pytest-cov (>=5)", "pytes [[package]] name = "pytest" -version = "7.4.4" +version = "8.3.4" description = "pytest: simple powerful testing with Python" optional = false -python-versions = ">=3.7" +python-versions = ">=3.8" groups = ["dev"] files = [ - {file = "pytest-7.4.4-py3-none-any.whl", hash = "sha256:b090cdf5ed60bf4c45261be03239c2c1c22df034fbffe691abe93cd80cea01d8"}, - {file = "pytest-7.4.4.tar.gz", hash = "sha256:2cf0005922c6ace4a3e2ec8b4080eb0d9753fdc93107415332f50ce9e7994280"}, + {file = "pytest-8.3.4-py3-none-any.whl", hash = "sha256:50e16d954148559c9a74109af1eaf0c945ba2d8f30f0a3d3335edde19788b6f6"}, + {file = "pytest-8.3.4.tar.gz", hash = "sha256:965370d062bce11e73868e0335abac31b4d3de0e82f4007408d242b4f8610761"}, ] [package.dependencies] @@ -187,11 +187,11 @@ colorama = {version = "*", markers = "sys_platform == \"win32\""} exceptiongroup = {version = ">=1.0.0rc8", markers = "python_version < \"3.11\""} iniconfig = "*" packaging = "*" -pluggy = ">=0.12,<2.0" -tomli = {version = ">=1.0.0", markers = "python_version < \"3.11\""} +pluggy = ">=1.5,<2" +tomli = {version = ">=1", markers = "python_version < \"3.11\""} [package.extras] -testing = ["argcomplete", "attrs (>=19.2.0)", "hypothesis (>=3.56)", "mock", "nose", "pygments (>=2.7.2)", "requests", "setuptools", "xmlschema"] +dev = ["argcomplete", "attrs (>=19.2)", "hypothesis (>=3.56)", "mock", "pygments (>=2.7.2)", "requests", "setuptools", "xmlschema"] [[package]] name = "pytest-randomly" @@ -360,4 +360,4 @@ virtualenv = "*" [metadata] lock-version = "2.1" python-versions = ">=3.10" -content-hash = "9e720abd0018156ac6989a98516ad781f38008a19c6d6008840159281926a354" +content-hash = "6339967c3f6cad8e4db7047ef3d12a5b059a279d0f7c98515c961477680bab8f" diff --git a/pyproject.toml b/pyproject.toml index d0cd19e..243eed0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -19,8 +19,8 @@ packages = [{ include = "voicemeeterlib" }] poethepoet = "^0.32.1" [tool.poetry.group.dev.dependencies] -pytest = "^7.4.4" -pytest-randomly = "^3.12.0" +pytest = "^8.3.4" +pytest-randomly = "^3.16.0" ruff = "^0.8.6" tox = "^4.23.2" virtualenv-pyenv = "^0.5.0" @@ -37,39 +37,42 @@ levels.script = "scripts:ex_levels" midi.script = "scripts:ex_midi" obs.script = "scripts:ex_obs" observer.script = "scripts:ex_observer" -test_basic.script = "scripts:test_basic" -test_banana.script = "scripts:test_banana" -test_potato.script = "scripts:test_potato" -test_all.script = "scripts:test_all" +test-basic.script = "scripts:test_basic" +test-banana.script = "scripts:test_banana" +test-potato.script = "scripts:test_potato" +test-all.script = "scripts:test_all" [tool.tox] legacy_tox_ini = """ -[tox] -envlist = py310,py311,py312 + [tox] + envlist = py310,py311,py312,py313 -[testenv] -passenv = * -setenv = VIRTUALENV_DISCOVERY=pyenv -allowlist_externals = poetry -commands = - poetry install -v - poetry run pytest tests/ + [testenv] + passenv = * + setenv = VIRTUALENV_DISCOVERY=pyenv + allowlist_externals = poetry + commands_pre = + poetry install --no-interaction --no-root + commands = + poetry run pytest tests -[testenv:dsl] -setenv = VIRTUALENV_DISCOVERY=pyenv -allowlist_externals = poetry -deps = pyparsing -commands = - poetry install -v --without dev - poetry run python examples/dsl/ + [testenv:dsl] + setenv = VIRTUALENV_DISCOVERY=pyenv + allowlist_externals = poetry + deps = pyparsing + commands_pre = + poetry install --no-interaction --no-root --without dev + commands = + poetry run python examples/dsl -[testenv:obs] -setenv = VIRTUALENV_DISCOVERY=pyenv -allowlist_externals = poetry -deps = obsws-python -commands = - poetry install -v --without dev - poetry run python examples/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/obs """ [tool.ruff] diff --git a/scripts.py b/scripts.py index 43955c6..e7c80a1 100644 --- a/scripts.py +++ b/scripts.py @@ -51,4 +51,5 @@ def test_potato(): def test_all(): steps = [test_basic, test_banana, test_potato] - [step() for step in steps] + for step in steps: + step()