def test_not_writes_matcher_as_mismatch_description(): mismatch_output = [] not_(equal_to("Blah")).matches("Blah", mismatch_output) assert_equals(["got value matching: 'Blah'"], mismatch_output)
def test_not_to_str_prefixes_not_to_matcher_description(): assert_equals(str(not_(equal_to("Blah"))), "not 'Blah'")
def test_not_does_not_write_to_mismatch_output_if_it_matches(): mismatch_output = [] assert not_(equal_to(1)).matches("Blah", mismatch_output) assert not_(equal_to("Blah")).matches(1, mismatch_output) assert not mismatch_output
def test_not_negates_given_matcher(): assert not not_(equal_to(1)).matches(1, []) assert not not_(equal_to("Blah")).matches("Blah", []) assert not_(equal_to(1)).matches("Blah", []) assert not_(equal_to("Blah")).matches(1, [])