Skip to content

Commit

Permalink
Add test_missing_attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
alexmojaki committed Mar 15, 2020
1 parent f392c60 commit 87d9b30
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pandas/tests/frame/test_query_eval.py
Original file line number Diff line number Diff line change
Expand Up @@ -1165,6 +1165,11 @@ def test_lots_of_operators_string(self, df):
expect = df[df[" &^ :!€$?(} > <++*'' "] > 4]
tm.assert_frame_equal(res, expect)

def test_missing_attribute(self, df):
message = "module 'pandas' has no attribute 'thing'"
with pytest.raises(AttributeError, match=message):
df.eval("@pd.thing")

def test_failing_quote(self, df):
with pytest.raises(SyntaxError):
df.query("`it's` > `that's`")
Expand Down

0 comments on commit 87d9b30

Please sign in to comment.