I have created a few test classes using "unittest" package to my Python app.
In this app, there is a step that the user inserts a path to excel file (from the GUI) and I want to test some cases about this input file. 
In my test class, I want to kill the program if the user inserts the wrong input (and verifies that exception was thrown).
The problem begins because:
The behavior of the program is to open a pop-up window (represents the error) and return to the main menu.
So, what is the way to stop my program (from test class) after the pop-up window was opened?
I'm thinking to use tearDown, but I need some advice to kill the program and not continue to the main menu.
Correct me if i'm wrong, I dont know much about this, but I believe exit() will work if you put it within the exception condition. Hope I was able to help!
How to kill Python program from Test class using 'unittest'?