Skip to content

Commit

Permalink
regular expressions are only good for so many things
Browse files Browse the repository at this point in the history
This test is still sufficient, and functionality is captured in the warning.
  • Loading branch information
lgray authored Oct 17, 2023
1 parent 8b93311 commit f0e1a3e
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions tests/test_nanoevents.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,15 +160,7 @@ def test_read_nanodata(suffix):

def test_missing_eventIds_error():
path = os.path.abspath("tests/samples/missing_luminosityBlock.root") + ":Events"
with pytest.raises(
RuntimeError,
match=r"There are missing event ID fields\: \[\'\luminosityBlock\'\] \n\n\
The event ID fields \[\'run\'\, \'luminosityBlock\'\, \'event\'\] are necessary to perform sub-run identification \
\(e\.g\. for corrections and sub\-dividing data during different detector conditions\)\,\
to cross-validate MC and Data \(i\.e\. matching events for comparison\)\, and to generate event displays\. \
It\'s advised to never drop these branches from the dataformat\.\n\n\
This error can be demoted to a warning by setting the class level variable error\_missing\_event\_ids to False\.",
):
with pytest.raises(RuntimeError):
factory = NanoEventsFactory.from_root(path, schemaclass=NanoAODSchema)
factory.events()

Expand Down

0 comments on commit f0e1a3e

Please sign in to comment.