Skip to content

Commit

Permalink
feat: support pytest 8.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
art049 committed Mar 18, 2024
1 parent 56e6211 commit 43ae25d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/pytest_codspeed/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

import pytest
from _pytest.fixtures import FixtureManager
from _pytest.nodes import Node

from pytest_codspeed.utils import get_git_relative_uri

Expand All @@ -28,6 +29,7 @@

IS_PYTEST_BENCHMARK_INSTALLED = pkgutil.find_loader("pytest_benchmark") is not None
SUPPORTS_PERF_TRAMPOLINE = sys.version_info >= (3, 12)
BEFORE_PYTEST_8_1_1 = pytest.version_tuple < (8, 1, 1)


@pytest.hookimpl(trylast=True)
Expand Down Expand Up @@ -95,7 +97,8 @@ def pytest_plugin_registered(plugin, manager: "pytest.PytestPluginManager"):
codspeed_plugin: CodSpeedPlugin = manager.get_plugin(PLUGIN_NAME)
if codspeed_plugin.is_codspeed_enabled:
codspeed_benchmark_fixtures = plugin.getfixturedefs(
"codspeed_benchmark", ""
"codspeed_benchmark",
"" if BEFORE_PYTEST_8_1_1 else Node(""),
)
assert codspeed_benchmark_fixtures is not None
fixture_manager._arg2fixturedefs[
Expand Down

0 comments on commit 43ae25d

Please sign in to comment.