diff --git a/tests/test_0029-more-string-types.py b/tests/test_0029_more_string_types.py similarity index 98% rename from tests/test_0029-more-string-types.py rename to tests/test_0029_more_string_types.py index b3b14bc05..ab7c73fc8 100644 --- a/tests/test_0029-more-string-types.py +++ b/tests/test_0029_more_string_types.py @@ -1,9 +1,5 @@ # BSD 3-Clause License; see https://github.com/scikit-hep/uproot5/blob/main/LICENSE -import json -import sys - -import numpy import pytest import skhep_testdata @@ -82,7 +78,7 @@ def test_parse_typename(): parse_typename("map>") -def test_strings1(): +def test_strings_1(): with uproot.open(skhep_testdata.data_path("uproot-small-evnt-tree-fullsplit.root"))[ "tree" ] as tree: @@ -166,7 +162,7 @@ def test_top_level_vectors(): ] -def test_strings1(): +def test_strings_2(): with uproot.open(skhep_testdata.data_path("uproot-issue31.root"))[ "T/name" ] as branch: @@ -174,7 +170,7 @@ def test_strings1(): assert result.tolist() == ["one", "two", "three", "four", "five"] -def test_strings2(): +def test_strings_3(): with uproot.open(skhep_testdata.data_path("uproot-small-evnt-tree-fullsplit.root"))[ "tree/Str" ] as branch: @@ -182,7 +178,7 @@ def test_strings2(): assert result.tolist() == [f"evt-{i:03d}" for i in range(100)] -def test_strings3(): +def test_strings_4(): with uproot.open(skhep_testdata.data_path("uproot-small-evnt-tree-fullsplit.root"))[ "tree/StdStr" ] as branch: diff --git a/tests/test_0341-manipulate-streamer-info.py b/tests/test_0341_manipulate_streamer_info.py similarity index 98% rename from tests/test_0341-manipulate-streamer-info.py rename to tests/test_0341_manipulate_streamer_info.py index 5c9fb50b3..23c18d4b7 100644 --- a/tests/test_0341-manipulate-streamer-info.py +++ b/tests/test_0341_manipulate_streamer_info.py @@ -2,7 +2,6 @@ import os -import numpy as np import pytest import uproot @@ -80,7 +79,7 @@ def test_with_mkdir(tmp_path): f6.mkdir("three") -def test_add_streamers1(tmp_path): +def test_add_streamers_1(tmp_path): has_TObjString = os.path.join(tmp_path, "has_TObjString.root") f_TObjString = ROOT.TFile(has_TObjString, "recreate") @@ -120,7 +119,7 @@ def test_add_streamers1(tmp_path): f4.Close() -def test_add_streamers2(tmp_path): +def test_add_streamers_2(tmp_path): has_histogram = os.path.join(tmp_path, "has_histogram.root") f_histogram = ROOT.TFile(has_histogram, "recreate") @@ -208,7 +207,7 @@ def test_add_streamers2(tmp_path): f3.Close() -def test_add_streamers3(tmp_path): +def test_add_streamers_3(tmp_path): has_TObjString = os.path.join(tmp_path, "has_TObjString.root") f_TObjString = ROOT.TFile(has_TObjString, "recreate") diff --git a/tests/test_0692_fsspec_reading.py b/tests/test_0692_fsspec_reading.py index 06fe25592..e8970ecd1 100644 --- a/tests/test_0692_fsspec_reading.py +++ b/tests/test_0692_fsspec_reading.py @@ -9,6 +9,7 @@ import fsspec import requests import os +import sys def test_open_fsspec_http(server): @@ -53,13 +54,17 @@ def test_open_fsspec_local(): @pytest.mark.parametrize( "handler", [ - # uproot.source.fsspec.FSSpecSource, + uproot.source.fsspec.FSSpecSource, uproot.source.s3.S3Source, None, ], ) def test_open_fsspec_s3(handler): pytest.importorskip("s3fs") + if sys.version_info < (3, 11): + pytest.skip( + "https://github.com/scikit-hep/uproot5/pull/1012", + ) with uproot.open( "s3://pivarski-princeton/pythia_ppZee_run17emb.picoDst.root:PicoDst", diff --git a/tests/test_0916_read_from_s3.py b/tests/test_0916_read_from_s3.py index c8f5cea64..ef85a2949 100644 --- a/tests/test_0916_read_from_s3.py +++ b/tests/test_0916_read_from_s3.py @@ -1,5 +1,7 @@ # BSD 3-Clause License; see https://github.com/scikit-hep/uproot5/blob/main/LICENSE +import socket + import pytest import uproot @@ -7,11 +9,10 @@ pytest.importorskip("minio") -@pytest.mark.skip("https://github.com/scikit-hep/uproot5/pull/1012") @pytest.mark.network def test_s3_fail(): - # TODO: fix this! Something not closing properly. - with pytest.raises(FileNotFoundError): + with pytest.raises((FileNotFoundError, TimeoutError, socket.timeout)): + # Sometimes this raises a timeout error that doesn't go away for a long time, we might as well skip it. with uproot.source.s3.S3Source( "s3://pivarski-princeton/does-not-exist", timeout=0.1 ) as source: