-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[df] Add Python test with empty list of filenames
- Loading branch information
1 parent
fb679bf
commit b4bc365
Showing
2 changed files
with
36 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import cppyy | ||
import platform | ||
import unittest | ||
|
||
import ROOT | ||
|
||
|
||
class RDataFrameMisc(unittest.TestCase): | ||
"""Miscellaneous RDataFrame tests""" | ||
|
||
def test_empty_filenames(self): | ||
""" | ||
An empty list of filenames should be detected and the user should be informed | ||
""" | ||
# See https://github.com/root-project/root/issues/7541 and | ||
# https://bugs.llvm.org/show_bug.cgi?id=49692 : | ||
# llvm JIT fails to catch exceptions on MacOS ARM, so we disable their testing | ||
# Also fails on Windows 64bit for the same reason | ||
if ( | ||
(platform.processor() != "arm" or platform.mac_ver()[0] == '') and not | ||
(platform.system() == "Windows" and platform.architecture()[0] == "64bit") | ||
): | ||
with self.assertRaisesRegexp(cppyy.gbl.runtime_error, "RDataFrame: empty list of input files."): | ||
ROOT.RDataFrame("events", []) | ||
|
||
with self.assertRaisesRegexp(cppyy.gbl.runtime_error, "RDataFrame: empty list of input files."): | ||
ROOT.RDataFrame("events", ROOT.std.vector[ROOT.std.string]()) | ||
|
||
with self.assertRaisesRegexp(cppyy.gbl.runtime_error, "RDataFrame: empty list of input files."): | ||
ROOT.RDataFrame("events", ()) | ||
|
||
|
||
if __name__ == '__main__': | ||
unittest.main() |