Skip to content

Commit

Permalink
Explicitly test for failure of the First.
Browse files Browse the repository at this point in the history
  • Loading branch information
gordonwatts committed Jul 4, 2024
1 parent 2f86b33 commit 469c1c3
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions tests/atlas/xaod/test_integrated_query.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,24 @@ def test_first_object_in_event():
assert int(training_df.iloc[0]["col1"]) == 52 # type: ignore


def test_no_first_object_in_event(caplog):
"Make sure a failed first properly blows its stack"
try:
as_pandas(
f_single.Select(
lambda e: e.Jets("AntiKt4EMTopoJets")
.Where(lambda j: j.pt() > 1000000000.0)
.First()
.pt()
/ 1000.0
)
)
except Exception as e:
assert "docker" in str(e)

assert "caught exception: First() called on an empty sequence" in caplog.text


def test_no_reported_statistics():
"Look at the log file and report if it contains a statistics line"

Expand Down

0 comments on commit 469c1c3

Please sign in to comment.