diff --git a/Makefile b/Makefile index 117b8b5b5..a57c7a7e8 100644 --- a/Makefile +++ b/Makefile @@ -25,7 +25,7 @@ pytest_flags = -p no:warnings --cov-report=term --cov-report=html --cov-report=x .PHONY: tests-cli tests-cli: - pytest --durations=10 --cov=hathor/cli/ --cov-config=.coveragerc_full --cov-fail-under=27 -p no:warnings $(tests_cli) + pytest -n auto --durations=10 --cov=hathor/cli/ --cov-config=.coveragerc_full --cov-fail-under=27 -p no:warnings $(tests_cli) .PHONY: tests-doctests tests-doctests: @@ -33,7 +33,7 @@ tests-doctests: .PHONY: tests-lib tests-lib: - pytest --durations=10 $(pytest_flags) --doctest-modules hathor $(tests_lib) + pytest -n auto --durations=10 $(pytest_flags) --doctest-modules hathor $(tests_lib) .PHONY: tests-quick tests-quick: @@ -41,8 +41,8 @@ tests-quick: .PHONY: tests-genesis tests-genesis: - HATHOR_TEST_CONFIG_FILE=hathor.conf.mainnet pytest tests/tx/test_genesis.py - HATHOR_TEST_CONFIG_FILE=hathor.conf.testnet pytest tests/tx/test_genesis.py + HATHOR_TEST_CONFIG_FILE=hathor.conf.mainnet pytest -n auto tests/tx/test_genesis.py + HATHOR_TEST_CONFIG_FILE=hathor.conf.testnet pytest -n auto tests/tx/test_genesis.py .PHONY: tests tests: tests-cli tests-lib tests-genesis diff --git a/poetry.lock b/poetry.lock index b8c67500c..53ace988c 100644 --- a/poetry.lock +++ b/poetry.lock @@ -543,6 +543,21 @@ files = [ [package.extras] test = ["pytest (>=6)"] +[[package]] +name = "execnet" +version = "1.9.0" +description = "execnet: rapid multi-Python deployment" +category = "dev" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" +files = [ + {file = "execnet-1.9.0-py2.py3-none-any.whl", hash = "sha256:a295f7cc774947aac58dde7fdc85f4aa00c42adf5d8f5468fc630c1acf30a142"}, + {file = "execnet-1.9.0.tar.gz", hash = "sha256:8f694f3ba9cc92cab508b152dcfe322153975c29bda272e2fd7f3f00f36e47c5"}, +] + +[package.extras] +testing = ["pre-commit"] + [[package]] name = "executing" version = "1.2.0" @@ -1388,6 +1403,27 @@ pytest = ">=4.6" [package.extras] testing = ["fields", "hunter", "process-tests", "pytest-xdist", "six", "virtualenv"] +[[package]] +name = "pytest-xdist" +version = "3.2.0" +description = "pytest xdist plugin for distributed testing, most importantly across multiple CPUs" +category = "dev" +optional = false +python-versions = ">=3.7" +files = [ + {file = "pytest-xdist-3.2.0.tar.gz", hash = "sha256:fa10f95a2564cd91652f2d132725183c3b590d9fdcdec09d3677386ecf4c1ce9"}, + {file = "pytest_xdist-3.2.0-py3-none-any.whl", hash = "sha256:336098e3bbd8193276867cc87db8b22903c3927665dff9d1ac8684c02f597b68"}, +] + +[package.dependencies] +execnet = ">=1.1" +pytest = ">=6.2.0" + +[package.extras] +psutil = ["psutil (>=3.0)"] +setproctitle = ["setproctitle"] +testing = ["filelock"] + [[package]] name = "pywin32" version = "305" @@ -2089,4 +2125,4 @@ sentry = ["sentry-sdk", "structlog-sentry"] [metadata] lock-version = "2.0" python-versions = ">=3.8.1,<4" -content-hash = "946c222413b41c9a41565b56ee7ea51fae63b5a4c407802e9d23ee835444cc6d" +content-hash = "056c71c5c772821b6deb3942e13fec4fa142ed01ced31f56b9db108c366adc5b" diff --git a/pyproject.toml b/pyproject.toml index 0d0703127..18e3b023d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -44,6 +44,7 @@ mypy-zope = {version = "^0.3", markers = "implementation_name == 'cpython'"} pytest = "~7.2.0" pytest-cov = "~4.0.0" flaky = "~3.7.0" +pytest-xdist = "~3.2.0" # stubs: types-requests = "=2.28.11.4" types-pyopenssl = "=22.1.0.2"