class SpamTest(TestCase):

    def test_bar(self):
        with patch('spam.foo') as mock:
            t = bar()
t.join()
mock.assert_called_once_with('potato', y='spam', x=69)
How to unittest that a thread is spawned?