How to properly use unit-testing’s assertRaises() with NoneType objects? [duplicate]
This question already has answers here: How do you test that a Python function throws an exception? (18 answers) Closed 4 years ago. I did a simple test case: def setUp(self): self.testListNone = None def testListSlicing(self): self.assertRaises(TypeError, self.testListNone[:1]) and I am expecting test to pass, but I am getting exception: Traceback (most recent call last): … Read more