Below is the how the program is set up. I have a UI that is (naturally) waiting for user input.
root = Tk()
root.title("This space intentionally left blank")
mainFrame = Frame(root)
mainFrame.grid(column=1, row=2)
sideFrame=Frame(root)
sideFrame.grid(column=2, row=2)
topLabelFrame=Frame(root)
topLabelFrame.grid(column=1, row=1, columnspan=99)
main()
root.mainloop()
This is my unit test:
from unittest import TestCase
from AL2.AutoLinker2_0 import InputProcessor
class TestInputProcessor(TestCase):
def test_tokenize(self):
IP = InputProcessor("")
self.assertEqual(IP.tokenize("elbow mac"), ["elbow", "mac"])
When I run, my UI pops up and hangs up the unit tests until I close the UI. I'm new to unit testing, but my understanding was that a unit test should only test the class and shouldn't need to run the entire program. Is this me not understanding, or is this maybe an issue with the IDE (pycharm), or is my program set up wrong? Thanks!