Remove assert for pytest.raises