MCPcopy
hub / github.com/pandas-dev/pandas / test_catch_undefined_variable_error

Function test_catch_undefined_variable_error

pandas/tests/test_errors.py:77–85  ·  view source on GitHub ↗
(is_local)

Source from the content-addressed store, hash-verified

75
76@pytest.mark.parametrize("is_local", [True, False])
77def test_catch_undefined_variable_error(is_local):
78 variable_name = "x"
79 if is_local:
80 msg = f"local variable '{variable_name}' is not defined"
81 else:
82 msg = f"name '{variable_name}' is not defined"
83
84 with pytest.raises(UndefinedVariableError, match=msg):
85 raise UndefinedVariableError(variable_name, is_local)
86
87
88class Foo:

Callers

nothing calls this directly

Calls 2

raisesMethod · 0.45

Tested by

no test coverage detected