This doesn't raise AssertionError it raises a "Failed" somewhere inside pytest.raises. I think xfail matches the interface better given than the test is only 2 lines longs.