Skip to content

AttributeError on pytest main due to missing _nodeid #321

Description

@The-Compiler
.tox/bleeding/lib/python3.14/site-packages/pytest_benchmark/plugin.py:494: in benchmark
    fixture = BenchmarkFixture(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <pytest_benchmark.fixture.BenchmarkFixture object at 0x7fbf044d82d0>
node = <Function test_match_benchmark[webengine]>, disable_gc = False
timer = NameWrapper(<built-in function perf_counter>), min_rounds = 5
min_time = Decimal('0.000005'), max_time = Decimal('1.0'), precision = None
confidence = 0.99, warmup = False, warmup_iterations = 100000
calibration_precision = 10
add_stats = <built-in method append of list object at 0x7fbf4dde7480>
logger = <pytest_benchmark.logger.Logger object at 0x7fbf4df1c980>
warner = <bound method Node.warn of <Function test_match_benchmark[webengine]>>
disabled = False, cprofile = False, cprofile_loops = 1, cprofile_dump = False
group = None

    def __init__(
        self,
        node,
        disable_gc,
        timer,
        min_rounds,
        min_time,
        max_time,
        precision,
        confidence,
        warmup,
        warmup_iterations,
        calibration_precision,
        add_stats,
        logger,
        warner,
        disabled,
        cprofile,
        cprofile_loops,
        cprofile_dump,
        group=None,
    ):
        self.name = node.name
>       self.fullname = node._nodeid
                        ^^^^^^^^^^^^
Error: E       AttributeError: 'Function' object has no attribute '_nodeid'. Did you mean: 'nodeid'?

.tox/bleeding/lib/python3.14/site-packages/pytest_benchmark/fixture.py:88: AttributeError

due to this recently merged PR: pytest-dev/pytest#14758

For inspiration for a possible fix: pytest-dev/pytest-rerunfailures#363

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions