pytest-pickle-cache 0.1.2__tar.gz → 0.1.3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -8,6 +8,7 @@
8
8
  "extensions": [
9
9
  "charliermarsh.ruff",
10
10
  "fill-labs.dependi",
11
+ "markis.code-coverage",
11
12
  "ms-python.python",
12
13
  "ms-python.vscode-pylance",
13
14
  "tamasfe.even-better-toml"
@@ -5,6 +5,4 @@ mkdir -p ~/.config
5
5
  cp .devcontainer/starship.toml ~/.config
6
6
 
7
7
  curl -LsSf https://astral.sh/uv/install.sh | sh
8
- source $HOME/.cargo/env
9
- uv tool install ruff@latest
10
8
  echo 'eval "$(uv generate-shell-completion bash)"' >> ~/.bashrc
@@ -0,0 +1 @@
1
+ .devcontainer/* linguist-vendored
@@ -0,0 +1,51 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+
8
+ concurrency:
9
+ group: test-${{ github.head_ref }}
10
+ cancel-in-progress: true
11
+
12
+ env:
13
+ PYTHONUNBUFFERED: "1"
14
+ FORCE_COLOR: "1"
15
+
16
+ jobs:
17
+ run:
18
+ name: Python ${{ matrix.python-version }} on ${{ startsWith(matrix.os, 'macos-') && 'macOS' || startsWith(matrix.os, 'windows-') && 'Windows' || 'Linux' }}
19
+ runs-on: ${{ matrix.os }}
20
+ strategy:
21
+ fail-fast: false
22
+ matrix:
23
+ os: [ubuntu-latest, windows-latest, macos-latest]
24
+ python-version: ["3.10", "3.11", "3.12", "3.13"]
25
+
26
+ steps:
27
+ - uses: actions/checkout@v4
28
+ - name: Set up Python ${{ matrix.python-version }}
29
+ uses: actions/setup-python@v5
30
+ with:
31
+ python-version: ${{ matrix.python-version }}
32
+ allow-prereleases: true
33
+ - name: Install uv and ruff
34
+ run: pip install uv ruff
35
+ - name: Install the project
36
+ run: uv sync
37
+ - name: Ruff check
38
+ run: ruff check
39
+ - name: Run test
40
+ run: uv run pytest --junitxml=junit.xml
41
+ - name: Upload Codecov Results
42
+ if: success()
43
+ uses: codecov/codecov-action@v4
44
+ with:
45
+ token: ${{ secrets.CODECOV_TOKEN }}
46
+ file: lcov.info
47
+ - name: Upload test results to Codecov
48
+ if: ${{ !cancelled() }}
49
+ uses: codecov/test-results-action@v1
50
+ with:
51
+ token: ${{ secrets.CODECOV_TOKEN }}
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pytest-pickle-cache
3
- Version: 0.1.2
3
+ Version: 0.1.3
4
4
  Summary: A pytest plugin for caching test results using pickle.
5
5
  Project-URL: Documentation, https://github.com/daizutabi/pytest-pickle-cache
6
6
  Project-URL: Source, https://github.com/daizutabi/pytest-pickle-cache
@@ -135,7 +135,7 @@ def df(use_cache, request):
135
135
  return use_cache(f"key_{request.param}", lambda: create(request.param))
136
136
  ```
137
137
 
138
- ## Benefits of this Example
138
+ ## Benefits
139
139
 
140
140
  - **Efficiency in Testing**: By using `pytest-pickle-cache`, you can avoid running
141
141
  the same test multiple times, reducing the overall test execution time.
@@ -148,7 +148,7 @@ for the same input, maintaining consistency in your tests.
148
148
  [pypi-v-link]: https://pypi.org/project/pytest-pickle-cache/
149
149
  [python-v-image]: https://img.shields.io/pypi/pyversions/pytest-pickle-cache.svg
150
150
  [python-v-link]: https://pypi.org/project/pytest-pickle-cache
151
- [GHAction-image]: https://github.com/daizutabi/pytest-pickle-cache/actions/workflows/ci.yml/badge.svg?branch=main&event=push
151
+ [GHAction-image]: https://github.com/daizutabi/pytest-pickle-cache/actions/workflows/ci.yaml/badge.svg?branch=main&event=push
152
152
  [GHAction-link]: https://github.com/daizutabi/pytest-pickle-cache/actions?query=event%3Apush+branch%3Amain
153
153
  [codecov-image]: https://codecov.io/github/daizutabi/pytest-pickle-cache/coverage.svg?branch=main
154
- [codecov-link]: https://codecov.io/github/daizutabi/pytest-pickle-cache?branch=main
154
+ [codecov-link]: https://codecov.io/github/daizutabi/pytest-pickle-cache?branch=main
@@ -104,7 +104,7 @@ def df(use_cache, request):
104
104
  return use_cache(f"key_{request.param}", lambda: create(request.param))
105
105
  ```
106
106
 
107
- ## Benefits of this Example
107
+ ## Benefits
108
108
 
109
109
  - **Efficiency in Testing**: By using `pytest-pickle-cache`, you can avoid running
110
110
  the same test multiple times, reducing the overall test execution time.
@@ -117,7 +117,7 @@ for the same input, maintaining consistency in your tests.
117
117
  [pypi-v-link]: https://pypi.org/project/pytest-pickle-cache/
118
118
  [python-v-image]: https://img.shields.io/pypi/pyversions/pytest-pickle-cache.svg
119
119
  [python-v-link]: https://pypi.org/project/pytest-pickle-cache
120
- [GHAction-image]: https://github.com/daizutabi/pytest-pickle-cache/actions/workflows/ci.yml/badge.svg?branch=main&event=push
120
+ [GHAction-image]: https://github.com/daizutabi/pytest-pickle-cache/actions/workflows/ci.yaml/badge.svg?branch=main&event=push
121
121
  [GHAction-link]: https://github.com/daizutabi/pytest-pickle-cache/actions?query=event%3Apush+branch%3Amain
122
122
  [codecov-image]: https://codecov.io/github/daizutabi/pytest-pickle-cache/coverage.svg?branch=main
123
- [codecov-link]: https://codecov.io/github/daizutabi/pytest-pickle-cache?branch=main
123
+ [codecov-link]: https://codecov.io/github/daizutabi/pytest-pickle-cache?branch=main
@@ -4,21 +4,21 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "pytest-pickle-cache"
7
- version = "0.1.2"
8
- authors = [{ name = "daizutabi", email = "daizutabi@gmail.com" }]
7
+ version = "0.1.3"
9
8
  description = "A pytest plugin for caching test results using pickle."
10
9
  readme = "README.md"
11
10
  license = { file = "LICENSE" }
11
+ authors = [{ name = "daizutabi", email = "daizutabi@gmail.com" }]
12
12
  classifiers = [
13
- "Framework :: Pytest",
14
- "Intended Audience :: Developers",
15
- "License :: OSI Approved :: MIT License",
16
- "Topic :: Software Development :: Testing",
17
- "Programming Language :: Python",
18
- "Programming Language :: Python :: 3.10",
19
- "Programming Language :: Python :: 3.11",
20
- "Programming Language :: Python :: 3.12",
21
- "Programming Language :: Python :: 3.13",
13
+ "Framework :: Pytest",
14
+ "Intended Audience :: Developers",
15
+ "License :: OSI Approved :: MIT License",
16
+ "Topic :: Software Development :: Testing",
17
+ "Programming Language :: Python",
18
+ "Programming Language :: Python :: 3.10",
19
+ "Programming Language :: Python :: 3.11",
20
+ "Programming Language :: Python :: 3.12",
21
+ "Programming Language :: Python :: 3.13",
22
22
  ]
23
23
  requires-python = ">=3.10"
24
24
  dependencies = ["pytest>=7"]
@@ -31,21 +31,12 @@ Issues = "https://github.com/daizutabi/pytest-pickle-cache/issues"
31
31
  [project.entry-points.pytest11]
32
32
  pickle_cache = "pytest_pickle_cache.plugin"
33
33
 
34
- [tool.uv]
35
- dev-dependencies = ["pandas>=2", "pytest-cov>=6.0"]
36
-
37
- [tool.hatch.build.targets.sdist]
38
- exclude = ["/.github", "/docs"]
39
-
40
- [tool.hatch.build.targets.wheel]
41
- packages = ["src/pytest_pickle_cache"]
34
+ [dependency-groups]
35
+ dev = ["pandas>=2", "pytest-cov>=6.0"]
42
36
 
43
37
  [tool.pytest.ini_options]
44
38
  addopts = ["--cov=pytest_pickle_cache", "--cov-report=lcov:lcov.info"]
45
39
 
46
- [tool.coverage.run]
47
- disable_warnings = ["module-not-measured"]
48
-
49
40
  [tool.coverage.report]
50
41
  exclude_lines = ["if TYPE_CHECKING:"]
51
42
  skip_covered = true
File without changes
@@ -0,0 +1 @@
1
+ pytest_plugins = ["pytester"]
@@ -0,0 +1,17 @@
1
+ import pytest
2
+
3
+
4
+ def test_fixture(pytester: pytest.Pytester):
5
+ result = pytester.runpytest("--fixtures")
6
+ assert "use_cache [session scope]" in result.stdout.str()
7
+
8
+
9
+ @pytest.fixture
10
+ def examples(pytester: pytest.Pytester):
11
+ pytester.copy_example("tests/test_use_cache.py")
12
+
13
+
14
+ def test_use_cache(pytester: pytest.Pytester, examples):
15
+ result = pytester.runpytest("-v")
16
+ outcomes = result.parseoutcomes()
17
+ assert outcomes["passed"] == 2