How to assert that an iterable is not empty on Unittest? January 31, 2023 by Tarik Empty lists/dicts evaluate to False, so self.assertTrue(d) gets the job done.