Home > Mobile >  VSCode: how to interrupt a running Python test?
VSCode: how to interrupt a running Python test?

Time:04-09

I'm using VSCode Test Explorer to run my Python unit tests. There was a bug in my code and my tested method never finishes.

How do I interrupt my test? I can't find how to do it using the GUI. I had to close VSCode to interrupt it.

I'm using pytest framework.

CodePudding user response:

Silly me, here is the Stop button:

Test stop button

CodePudding user response:

most test runners have a max-running-time setting

if a test takes longer it will be aborted and flagged as failed

From the pytest doc pages:

Create a file: pytest.ini

[pytest]
faulthandler_timeout=5
  • Related