class test_Foo(unittest.TestCase):

    def test_bar(self):
        obj = Foo()
res = obj.bar()
self.assertEqual(res, 7)
if __name__ == '__main__':
    unittest.main()
Is there a way to suppress printing that is done within a unit test?