def test_assert_that_raises_no_exception_can_use_as_with_dict_in_the_exception(self): try: with assert_that_raises(Warning) as captured: pass except AssertionError: pass assert_that(captured, has_entry('exception', is_(none())))
def test_assert_that_raises_with_unspecified_exception_can_use_as_with_dict_with_exception(self): try: with assert_that_raises(Warning) as captured: raise NameError() except AssertionError: pass assert_that(captured, has_entry('exception', is_(instance_of(NameError))))
def test_assert_that_raises_calls_matcher_on_exception(self): try: with assert_that_raises(instance_of(Warning)): raise NameError() except AssertionError: pass
def test_assert_that_raises_calls_matcher_on_exception(self): with assert_that_raises(instance_of(Warning)): raise Warning()
def test_assert_that_raises_can_use_as_with_a_dict_containing_the_exception(self): with assert_that_raises(Warning) as captured: raise Warning() assert_that(captured, has_entry('exception', is_(instance_of(Warning))))
def test_assert_that_raises_AssertionError_on_unspecified_exception(self): try: with assert_that_raises(Warning): raise NameError() except AssertionError: pass
def test_assert_that_raises_catches_the_specified_exception(self): with assert_that_raises(Warning): raise Warning()