Skip to content

Commit

Permalink
tests/test_1229_const_in_typename.py: test without a file
Browse files Browse the repository at this point in the history
  • Loading branch information
veprbl committed Jun 12, 2024
1 parent a23610d commit 72076e2
Showing 1 changed file with 6 additions and 15 deletions.
21 changes: 6 additions & 15 deletions tests/test_1229_const_in_typename.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,11 @@
import pytest
import skhep_testdata

import uproot
from uproot.containers import AsPointer
from uproot.interpretation.identify import parse_typename
from uproot.models.TH import Model_TH1I


@pytest.fixture(scope="module")
def datafile(tmpdir_factory):
yield skhep_testdata.data_path("uproot-issue-1229.root")


@pytest.fixture
def tree(datafile):
with uproot.open(datafile) as f:
yield f["tree"]


def test_const_in_typename(tree):
assert tree["branch/pointer"].typename == 'TFooMember*'
assert tree["branch/const_pointer"].typename == 'TFooMember*'
def test_const_in_typename():
assert parse_typename("TH1I*") == AsPointer(Model_TH1I)
assert parse_typename("const TH1I*") == AsPointer(Model_TH1I)

0 comments on commit 72076e2

Please sign in to comment.