Skip to content

Commit e1b54d0

Browse files
authored
fix no test id provided for pytest run (#22569)
fixes #22567 Now if a user tries to click the "run" button a empty folder (ie a folder with no tests in it) it will just run pytest with no testIds as args and notify the user.
1 parent 61fcf3a commit e1b54d0

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

pythonFiles/vscode_pytest/run_pytest_script.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,14 @@
6464
try:
6565
if test_ids_from_buffer:
6666
arg_array = ["-p", "vscode_pytest"] + args + test_ids_from_buffer
67+
print("Running pytest with args: " + str(arg_array))
68+
pytest.main(arg_array)
69+
else:
70+
print(
71+
"Error: No test ids received from stdin, could be an error or a run request without ids provided.",
72+
)
73+
print("Running pytest with no test ids as args. Args being used: ", args)
74+
arg_array = ["-p", "vscode_pytest"] + args
6775
pytest.main(arg_array)
6876
except json.JSONDecodeError:
6977
print("Error: Could not parse test ids from stdin")

0 commit comments

Comments
 (0)