def test_DummyContext(): with DummyContext(): pass with pytest.raises(KeyError): with DummyContext(): raise KeyError()
def test_context(self): with DummyContext(): pass with self.assertRaises(KeyError): with DummyContext(): raise KeyError()