mirror of
https://github.com/home-assistant/core.git
synced 2025-07-12 07:47:08 +00:00
Call pytest as python3 -m pytest (#101185)
This commit is contained in:
parent
425d961489
commit
f7aad4a9e6
6
.vscode/tasks.json
vendored
6
.vscode/tasks.json
vendored
@ -16,7 +16,7 @@
|
|||||||
{
|
{
|
||||||
"label": "Pytest",
|
"label": "Pytest",
|
||||||
"type": "shell",
|
"type": "shell",
|
||||||
"command": "pytest --timeout=10 tests",
|
"command": "python3 -m pytest --timeout=10 tests",
|
||||||
"dependsOn": ["Install all Test Requirements"],
|
"dependsOn": ["Install all Test Requirements"],
|
||||||
"group": {
|
"group": {
|
||||||
"kind": "test",
|
"kind": "test",
|
||||||
@ -31,7 +31,7 @@
|
|||||||
{
|
{
|
||||||
"label": "Pytest (changed tests only)",
|
"label": "Pytest (changed tests only)",
|
||||||
"type": "shell",
|
"type": "shell",
|
||||||
"command": "pytest --timeout=10 --picked",
|
"command": "python3 -m pytest --timeout=10 --picked",
|
||||||
"group": {
|
"group": {
|
||||||
"kind": "test",
|
"kind": "test",
|
||||||
"isDefault": true
|
"isDefault": true
|
||||||
@ -75,7 +75,7 @@
|
|||||||
"label": "Code Coverage",
|
"label": "Code Coverage",
|
||||||
"detail": "Generate code coverage report for a given integration.",
|
"detail": "Generate code coverage report for a given integration.",
|
||||||
"type": "shell",
|
"type": "shell",
|
||||||
"command": "pytest ./tests/components/${input:integrationName}/ --cov=homeassistant.components.${input:integrationName} --cov-report term-missing --durations-min=1 --durations=0 --numprocesses=auto",
|
"command": "python3 -m pytest ./tests/components/${input:integrationName}/ --cov=homeassistant.components.${input:integrationName} --cov-report term-missing --durations-min=1 --durations=0 --numprocesses=auto",
|
||||||
"group": {
|
"group": {
|
||||||
"kind": "test",
|
"kind": "test",
|
||||||
"isDefault": true
|
"isDefault": true
|
||||||
|
@ -223,7 +223,14 @@ async def main():
|
|||||||
return
|
return
|
||||||
|
|
||||||
code, _ = await async_exec(
|
code, _ = await async_exec(
|
||||||
"pytest", "-vv", "--force-sugar", "--", *test_files, display=True
|
"python3",
|
||||||
|
"-m",
|
||||||
|
"pytest",
|
||||||
|
"-vv",
|
||||||
|
"--force-sugar",
|
||||||
|
"--",
|
||||||
|
*test_files,
|
||||||
|
display=True,
|
||||||
)
|
)
|
||||||
print("=============================")
|
print("=============================")
|
||||||
|
|
||||||
|
@ -103,9 +103,16 @@ def main():
|
|||||||
|
|
||||||
if args.develop:
|
if args.develop:
|
||||||
print("Running tests")
|
print("Running tests")
|
||||||
print(f"$ pytest -vvv tests/components/{info.domain}")
|
print(f"$ python3 -m pytest -vvv tests/components/{info.domain}")
|
||||||
subprocess.run(
|
subprocess.run(
|
||||||
["pytest", "-vvv", f"tests/components/{info.domain}"], check=True
|
[
|
||||||
|
"python3",
|
||||||
|
"-m",
|
||||||
|
"pytest",
|
||||||
|
"-vvv",
|
||||||
|
f"tests/components/{info.domain}",
|
||||||
|
],
|
||||||
|
check=True,
|
||||||
)
|
)
|
||||||
print()
|
print()
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user