Skip to content

Commit

Permalink
Merge pull request #912 from CoffeaTeam/more-nanoevents-tests
Browse files Browse the repository at this point in the history
ci: remove unnecessary python version warnings, reactivate nanoevents tests
  • Loading branch information
lgray authored Oct 19, 2023
2 parents 072f701 + 8803af7 commit 13144f3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 20 deletions.
10 changes: 0 additions & 10 deletions src/coffea/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,6 @@

__version__ = version.__version__

import sys

if sys.version_info.major < 3:
import warnings

warnings.warn("coffea only supports python3 as of 1 January 2020!")
warnings.warn(
"If you are using python2 and run into problems please submit a pull request to fix the issue!"
)

# control severity for utils.deprecate
deprecations_as_errors = False

Expand Down
17 changes: 7 additions & 10 deletions tests/test_nanoevents.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,18 +61,19 @@ def crossref(events):
)


suffixes = ["root", "parquet"]
suffixes = [
"root",
# "parquet",
]


@pytest.mark.parametrize("suffix", suffixes)
def test_read_nanomc(suffix):
pytest.xfail("weird side effect from running other tests... passes by itself")

path = os.path.abspath(f"tests/samples/nano_dy.{suffix}")
# parquet files were converted from even older nanoaod
nanoversion = NanoAODSchema.v6 if suffix == "root" else NanoAODSchema.v5
factory = getattr(NanoEventsFactory, f"from_{suffix}")(
path, schemaclass=nanoversion
{path: "Events"}, schemaclass=nanoversion
)
events = factory.events()

Expand Down Expand Up @@ -129,13 +130,11 @@ def test_read_nanomc(suffix):
def test_read_from_uri(suffix):
"Make sure we can properly open the file when a uri is used"

pytest.xfail("weird side effect from running other tests... passes by itself")

path = Path(os.path.abspath(f"tests/samples/nano_dy.{suffix}")).as_uri()

nanoversion = NanoAODSchema.v6 if suffix == "root" else NanoAODSchema.v5
factory = getattr(NanoEventsFactory, f"from_{suffix}")(
path, schemaclass=nanoversion
{path: "Events"}, schemaclass=nanoversion
)
events = factory.events()

Expand All @@ -144,13 +143,11 @@ def test_read_from_uri(suffix):

@pytest.mark.parametrize("suffix", suffixes)
def test_read_nanodata(suffix):
pytest.xfail("weird side effect from running other tests... passes by itself")

path = os.path.abspath(f"tests/samples/nano_dimuon.{suffix}")
# parquet files were converted from even older nanoaod
nanoversion = NanoAODSchema.v6 if suffix == "root" else NanoAODSchema.v5
factory = getattr(NanoEventsFactory, f"from_{suffix}")(
path, schemaclass=nanoversion
{path: "Events"}, schemaclass=nanoversion
)
events = factory.events()

Expand Down

0 comments on commit 13144f3

Please sign in to comment.