From 388395c104aded0c083d9601c1965640d422a7d6 Mon Sep 17 00:00:00 2001 From: Jim Pivarski Date: Fri, 13 Oct 2023 15:24:48 -0500 Subject: [PATCH] fix: typo in `uproot.source.xrootd.XRootDSource` name (#990) * Fix typo in `uproot.source.xrootd.XRootDSource` name * test different handlers for xrootd --------- Co-authored-by: Luis Antonio Obis Aparicio Co-authored-by: Luis Antonio Obis Aparicio <35803280+lobis@users.noreply.github.com> --- src/uproot/_util.py | 2 +- tests/test_0692_fsspec.py | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/uproot/_util.py b/src/uproot/_util.py index bf946ea3d..5e1134491 100644 --- a/src/uproot/_util.py +++ b/src/uproot/_util.py @@ -432,7 +432,7 @@ def file_path_to_source_class(file_path, options): elif parsed_url.scheme.upper() == "ROOT": out = options["xrootd_handler"] if out is None: - out = uproot.source.root.XRootDSource + out = uproot.source.xrootd.XRootDSource else: warnings.warn( f"""In version 5.2.0, the 'xrootd_handler' argument will be removed from 'uproot.open'. Use diff --git a/tests/test_0692_fsspec.py b/tests/test_0692_fsspec.py index 255db6524..08725dccd 100644 --- a/tests/test_0692_fsspec.py +++ b/tests/test_0692_fsspec.py @@ -63,11 +63,15 @@ def test_open_fsspec_s3(): @pytest.mark.network @pytest.mark.xrootd -def test_open_fsspec_xrootd(): +@pytest.mark.parametrize( + "handler", + [uproot.source.fsspec.FSSpecSource, uproot.source.xrootd.XRootDSource, None], +) +def test_open_fsspec_xrootd(handler): pytest.importorskip("XRootD") with uproot.open( "root://eospublic.cern.ch//eos/root-eos/cms_opendata_2012_nanoaod/Run2012B_DoubleMuParked.root", - handler=uproot.source.fsspec.FSSpecSource, + handler=handler, ) as f: data = f["Events/run"].array(library="np", entry_stop=20) assert len(data) == 20