Skip to content

Commit bf30b24

Browse files
committed
chore: bump mypy
1 parent f1e42e4 commit bf30b24

File tree

4 files changed

+274
-244
lines changed

4 files changed

+274
-244
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ repos:
99
- id: check-yaml
1010
- id: check-added-large-files
1111
- repo: https://github.com/pre-commit/mirrors-mypy
12-
rev: v1.3.0
12+
rev: v1.18.2
1313
hooks:
1414
- id: mypy
1515
- repo: https://github.com/astral-sh/ruff-pre-commit

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ pytest-codspeed = { workspace = true }
4949
[dependency-groups]
5050
dev = [
5151
"pytest-codspeed",
52-
"mypy ~= 1.11.2",
52+
"mypy ~= 1.18.2",
5353
"ruff ~= 0.11.12",
5454
"pytest ~= 7.0",
5555
"pytest-cov ~= 4.0.0",

src/pytest_codspeed/plugin.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from dataclasses import dataclass, field
99
from pathlib import Path
1010
from time import time
11-
from typing import TYPE_CHECKING
11+
from typing import TYPE_CHECKING, cast
1212

1313
import pytest
1414
from _pytest.fixtures import FixtureManager
@@ -96,7 +96,7 @@ class CodSpeedPlugin:
9696

9797

9898
def get_plugin(config: pytest.Config) -> CodSpeedPlugin:
99-
return config.pluginmanager.get_plugin(PLUGIN_NAME)
99+
return cast("CodSpeedPlugin", config.pluginmanager.get_plugin(PLUGIN_NAME))
100100

101101

102102
@pytest.hookimpl(tryfirst=True)
@@ -159,13 +159,15 @@ def pytest_plugin_registered(plugin, manager: pytest.PytestPluginManager):
159159
plugin, FixtureManager
160160
):
161161
fixture_manager = plugin
162-
codspeed_plugin: CodSpeedPlugin = manager.get_plugin(PLUGIN_NAME)
162+
codspeed_plugin: CodSpeedPlugin = cast(
163+
"CodSpeedPlugin", manager.get_plugin(PLUGIN_NAME)
164+
)
163165
if codspeed_plugin.is_codspeed_enabled:
164166
codspeed_benchmark_fixtures = plugin.getfixturedefs(
165167
"codspeed_benchmark",
166168
fixture_manager.session.nodeid
167169
if BEFORE_PYTEST_8_1_1
168-
else fixture_manager.session,
170+
else cast("str", fixture_manager.session),
169171
)
170172
assert codspeed_benchmark_fixtures is not None
171173
# Archive the alternative benchmark fixture

0 commit comments

Comments
 (0)