Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
2ad18b5
omit coverage for test_benchmarks.py
Vizonex May 23, 2026
96cf9a4
Merge branch 'master' into coverage-change
Vizonex May 23, 2026
a47f68c
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] May 23, 2026
435dd47
add change to timeline
Vizonex May 23, 2026
276ddf3
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] May 23, 2026
e1b77a2
fix spelling and add new word to spelling wordlist
Vizonex May 23, 2026
5f99502
fix spelling and add new word to spelling wordlist
Vizonex May 23, 2026
8694bba
add more words
Vizonex May 23, 2026
75b6126
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] May 23, 2026
392f108
fix
Vizonex May 23, 2026
066df02
Merge branch 'coverage-change' of https://github.com/Vizonex/propcach…
Vizonex May 23, 2026
23cd523
try importorskip instead
Vizonex May 23, 2026
238e639
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] May 23, 2026
9c03eda
I don't recommend this but try no cover
Vizonex May 23, 2026
501a0f5
fix tests
Vizonex May 23, 2026
d951a49
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] May 23, 2026
901c7d9
per-commit is playing games with me again -_-
Vizonex May 23, 2026
0fe0c35
per-commit is playing games with me again -_-
Vizonex May 23, 2026
c8d44dc
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] May 23, 2026
c129637
change omit to fixed
Vizonex May 23, 2026
ad45c98
Merge branch 'coverage-change' of https://github.com/Vizonex/propcach…
Vizonex May 23, 2026
b54831a
Update tests/test_benchmarks.py
Vizonex May 23, 2026
5bdc5d9
Update tests/test_benchmarks.py
Vizonex May 23, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGES/251.contrib.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Fixed coverage for testing benchmarks when codspeed is not installed
-- by :user:`Vizonex`.
2 changes: 2 additions & 0 deletions docs/spelling_wordlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ booleans
bools
changelog
changelogs
codspeed
Copy link
Copy Markdown
Member

@Dreamsorcerer Dreamsorcerer May 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are libraries, I think it's better to just surround the words with backticks like code, rather than filling the spelling list with all of them.

config
de
decodable
Expand All @@ -45,6 +46,7 @@ preinstalled
propcache
pypa
pyproject
pytest
rc
reStructuredText
reencoding
Expand Down
24 changes: 16 additions & 8 deletions tests/test_benchmarks.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
"""codspeed benchmarks for propcache."""

import typing as _t

Check notice

Code scanning / CodeQL

Unused import Note test

Import of '_t' is not used.

import pytest

try:
from pytest_codspeed import BenchmarkFixture
except ImportError:
Comment thread
Dreamsorcerer marked this conversation as resolved.
pytestmark = pytest.mark.skip("pytest_codspeed needs to be installed")
if TYPE_CHECKING:
import pytest_codspeed
else:
Comment thread
Dreamsorcerer marked this conversation as resolved.
pytest_codspeed = pytest.importorskip("pytest_codspeed")

from propcache import cached_property, under_cached_property


def test_under_cached_property_cache_hit(benchmark: "BenchmarkFixture") -> None:
def test_under_cached_property_cache_hit(
benchmark: pytest_codspeed.BenchmarkFixture,
) -> None:
"""Benchmark for under_cached_property cache hit."""

class Test:
Expand All @@ -30,7 +34,7 @@
t.prop


def test_cached_property_cache_hit(benchmark: "BenchmarkFixture") -> None:
def test_cached_property_cache_hit(benchmark: pytest_codspeed.BenchmarkFixture) -> None:
"""Benchmark for cached_property cache hit."""

class Test:
Expand All @@ -50,7 +54,9 @@
t.prop


def test_under_cached_property_cache_miss(benchmark: "BenchmarkFixture") -> None:
def test_under_cached_property_cache_miss(
benchmark: pytest_codspeed.BenchmarkFixture,
) -> None:
"""Benchmark for under_cached_property cache miss."""

class Test:
Expand All @@ -72,7 +78,9 @@
t.prop


def test_cached_property_cache_miss(benchmark: "BenchmarkFixture") -> None:
def test_cached_property_cache_miss(
benchmark: pytest_codspeed.BenchmarkFixture,
) -> None:
"""Benchmark for cached_property cache miss."""

class Test:
Expand Down
Loading