pytest-csv-params 2.3.0__tar.gz → 2.4.0__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.
Files changed (22) hide show
  1. {pytest_csv_params-2.3.0 → pytest_csv_params-2.4.0}/PKG-INFO +10 -3
  2. {pytest_csv_params-2.3.0 → pytest_csv_params-2.4.0}/README.md +7 -1
  3. {pytest_csv_params-2.3.0 → pytest_csv_params-2.4.0}/_ptcsvp/version.py +20 -3
  4. {pytest_csv_params-2.3.0 → pytest_csv_params-2.4.0}/pyproject.toml +4 -3
  5. {pytest_csv_params-2.3.0 → pytest_csv_params-2.4.0}/pytest_csv_params/object.py +15 -0
  6. {pytest_csv_params-2.3.0 → pytest_csv_params-2.4.0}/.gitignore +0 -0
  7. {pytest_csv_params-2.3.0 → pytest_csv_params-2.4.0}/LICENSE.txt +0 -0
  8. {pytest_csv_params-2.3.0 → pytest_csv_params-2.4.0}/_ptcsvp/__init__.py +0 -0
  9. {pytest_csv_params-2.3.0 → pytest_csv_params-2.4.0}/_ptcsvp/cmdline.py +0 -0
  10. {pytest_csv_params-2.3.0 → pytest_csv_params-2.4.0}/_ptcsvp/configure.py +0 -0
  11. {pytest_csv_params-2.3.0 → pytest_csv_params-2.4.0}/_ptcsvp/exception.py +0 -0
  12. {pytest_csv_params-2.3.0 → pytest_csv_params-2.4.0}/_ptcsvp/parametrize.py +0 -0
  13. {pytest_csv_params-2.3.0 → pytest_csv_params-2.4.0}/_ptcsvp/plugin.py +0 -0
  14. {pytest_csv_params-2.3.0 → pytest_csv_params-2.4.0}/_ptcsvp/varname.py +0 -0
  15. {pytest_csv_params-2.3.0 → pytest_csv_params-2.4.0}/pytest_csv_params/__init__.py +0 -0
  16. {pytest_csv_params-2.3.0 → pytest_csv_params-2.4.0}/pytest_csv_params/decorator.py +0 -0
  17. {pytest_csv_params-2.3.0 → pytest_csv_params-2.4.0}/pytest_csv_params/dialect.py +0 -0
  18. {pytest_csv_params-2.3.0 → pytest_csv_params-2.4.0}/pytest_csv_params/exception.py +0 -0
  19. {pytest_csv_params-2.3.0 → pytest_csv_params-2.4.0}/pytest_csv_params/plugin.py +0 -0
  20. {pytest_csv_params-2.3.0 → pytest_csv_params-2.4.0}/pytest_csv_params/shortcut.py +0 -0
  21. {pytest_csv_params-2.3.0 → pytest_csv_params-2.4.0}/pytest_csv_params/types.py +0 -0
  22. {pytest_csv_params-2.3.0 → pytest_csv_params-2.4.0}/pytest_csv_params/warning.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: pytest-csv-params
3
- Version: 2.3.0
3
+ Version: 2.4.0
4
4
  Summary: Pytest plugin for Test Case Parametrization with CSV files
5
5
  Project-URL: repository, https://git.codebau.dev/pytest-plugins/pytest-csv-params
6
6
  Project-URL: homepage, https://git.codebau.dev/pytest-plugins/pytest-csv-params
@@ -27,10 +27,11 @@ Classifier: Programming Language :: Python :: 3.12
27
27
  Classifier: Programming Language :: Python :: 3.13
28
28
  Classifier: Programming Language :: Python :: 3.14
29
29
  Classifier: Programming Language :: Python :: 3.15
30
+ Classifier: Programming Language :: Python :: 3.16
30
31
  Classifier: Topic :: Software Development :: Quality Assurance
31
32
  Classifier: Topic :: Software Development :: Testing
32
33
  Classifier: Topic :: Utilities
33
- Requires-Python: <3.16,>=3.10
34
+ Requires-Python: <3.17,>=3.10
34
35
  Requires-Dist: pytest<10,>=8.3
35
36
  Description-Content-Type: text/markdown
36
37
 
@@ -49,7 +50,7 @@ A pytest plugin to parametrize data-driven tests by CSV files.
49
50
 
50
51
  ## Requirements
51
52
 
52
- - Python 3.10, 3.11, 3.12, 3.13, 3.14, 3.15
53
+ - Python 3.10, 3.11, 3.12, 3.13, 3.14, 3.15, 3.16
53
54
  - pytest >=8.3,<=9.2
54
55
 
55
56
  There's no operating system dependent code in this plugin, so it should run anywhere where pytest runs.
@@ -84,6 +85,12 @@ uv add --group dev pytest-csv-params
84
85
  **Detailed documentation can be found under
85
86
  [docs.codebau.dev/pytest-plugins/pytest-csv-params/](https://docs.codebau.dev/pytest-plugins/pytest-csv-params/)**
86
87
 
88
+ There are also a few blog posts by the author (in German):
89
+
90
+ - [`pytest-csv-params`: Renovierung und neue Features für Version 2](https://j4n.e7h.eu/articles/2026-10-08-pytest-csv-params-renovierung-neue-features-version-2 "German blog post 'pytest-csv-params: Renovierung und neue Features für Version 2'")
91
+ - [`pytest-csv-params`: Testfall-Daten als »smarte Objekte«](https://j4n.e7h.eu/articles/2026-10-13-pytest-csv-params-smart-object-feature "German blog post 'pytest-csv-params: Testfall-Daten als »smarte Objekte«'")
92
+ - [Datengetriebene (data-driven) parametrisierte Tests mit Pytest (pytest-csv-params)](https://juergen.rocks/blog/articles/data-driven-tests-mit-pytest-csv-params.html "German blog post 'Datengetriebene (data-driven) parametrisierte Tests mit Pytest (pytest-csv-params)'")
93
+
87
94
  ## Usage: Command Line Argument
88
95
 
89
96
  | Argument | Required | Description | Example |
@@ -13,7 +13,7 @@ A pytest plugin to parametrize data-driven tests by CSV files.
13
13
 
14
14
  ## Requirements
15
15
 
16
- - Python 3.10, 3.11, 3.12, 3.13, 3.14, 3.15
16
+ - Python 3.10, 3.11, 3.12, 3.13, 3.14, 3.15, 3.16
17
17
  - pytest >=8.3,<=9.2
18
18
 
19
19
  There's no operating system dependent code in this plugin, so it should run anywhere where pytest runs.
@@ -48,6 +48,12 @@ uv add --group dev pytest-csv-params
48
48
  **Detailed documentation can be found under
49
49
  [docs.codebau.dev/pytest-plugins/pytest-csv-params/](https://docs.codebau.dev/pytest-plugins/pytest-csv-params/)**
50
50
 
51
+ There are also a few blog posts by the author (in German):
52
+
53
+ - [`pytest-csv-params`: Renovierung und neue Features für Version 2](https://j4n.e7h.eu/articles/2026-10-08-pytest-csv-params-renovierung-neue-features-version-2 "German blog post 'pytest-csv-params: Renovierung und neue Features für Version 2'")
54
+ - [`pytest-csv-params`: Testfall-Daten als »smarte Objekte«](https://j4n.e7h.eu/articles/2026-10-13-pytest-csv-params-smart-object-feature "German blog post 'pytest-csv-params: Testfall-Daten als »smarte Objekte«'")
55
+ - [Datengetriebene (data-driven) parametrisierte Tests mit Pytest (pytest-csv-params)](https://juergen.rocks/blog/articles/data-driven-tests-mit-pytest-csv-params.html "German blog post 'Datengetriebene (data-driven) parametrisierte Tests mit Pytest (pytest-csv-params)'")
56
+
51
57
  ## Usage: Command Line Argument
52
58
 
53
59
  | Argument | Required | Description | Example |
@@ -5,7 +5,7 @@ the pytest version is recent enough (:meth:`check_pytest_version`).
5
5
  During the setup phase of the plugin (see :mod:`pytest_csv_params.plugin`) these methods are called.
6
6
  """
7
7
 
8
- import sys
8
+ import platform
9
9
  import warnings
10
10
 
11
11
  from packaging.version import parse
@@ -22,10 +22,27 @@ def check_python_version(min_version: tuple[int, int] = (3, 10), deprecation_bel
22
22
  :raises PythonVersionTooOldException: When the python version is too old/unsupported
23
23
  """
24
24
 
25
- if sys.version_info < min_version:
25
+ platform_version = platform.python_version().split(".")
26
+ version_arr = [0, 0, 0]
27
+
28
+ for i, version_part in enumerate(platform_version):
29
+ if i >= len(version_arr):
30
+ break
31
+ try:
32
+ v = int(version_part)
33
+ if v >= 0:
34
+ version_arr[i] = v
35
+ except ValueError:
36
+ pass
37
+
38
+ parsed_version = parse(".".join(map(str, version_arr)))
39
+ required_version = parse(".".join(map(str, min_version)))
40
+ deprecated_below_version = parse(".".join(map(str, deprecation_below)))
41
+
42
+ if parsed_version < required_version:
26
43
  raise PythonVersionTooOldException(f"At least Python {'.'.join(map(str, min_version))} required")
27
44
 
28
- if sys.version_info < deprecation_below:
45
+ if parsed_version < deprecated_below_version:
29
46
  warnings.warn(f"Python <{'.'.join(map(str, deprecation_below))} is deprecated", DeprecationWarning)
30
47
 
31
48
 
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "pytest-csv-params"
3
- version = "2.3.0"
3
+ version = "2.4.0"
4
4
  description = "Pytest plugin for Test Case Parametrization with CSV files"
5
5
  authors = [
6
6
  { name = "Juergen Edelbluth", email = "csv_params@jued.de" },
@@ -20,6 +20,7 @@ classifiers = [
20
20
  "Programming Language :: Python :: 3.13",
21
21
  "Programming Language :: Python :: 3.14",
22
22
  "Programming Language :: Python :: 3.15",
23
+ "Programming Language :: Python :: 3.16",
23
24
  "Topic :: Software Development :: Testing",
24
25
  "Topic :: Software Development :: Quality Assurance",
25
26
  "Operating System :: POSIX",
@@ -31,7 +32,7 @@ keywords = [
31
32
  "py.test", "pytest", "csv", "params", "parametrize", "pytest-plugin", "ddt", "data-driven"
32
33
  ]
33
34
 
34
- requires-python = ">=3.10,<3.16"
35
+ requires-python = ">=3.10,<3.17"
35
36
 
36
37
  dependencies = [
37
38
  "pytest>=8.3,<10",
@@ -57,7 +58,7 @@ docs = [
57
58
  ]
58
59
 
59
60
  [tool.uv.dependency-groups]
60
- dev = { requires-python = ">=3.11" }
61
+ dev = { requires-python = ">=3.10" }
61
62
  docs = { requires-python = ">=3.11,<3.15" }
62
63
 
63
64
  [project.urls]
@@ -2,9 +2,17 @@
2
2
  This module defines the smart object as test case data object.
3
3
  """
4
4
 
5
+ import re
5
6
  from collections.abc import Callable
7
+ from re import Pattern
6
8
  from typing import Any
7
9
 
10
+ FORBIDDEN_KEY_PATTERN: Pattern[str] = re.compile("^(__(.+)__)|(register_value)$", re.ASCII | re.DOTALL)
11
+ """
12
+ Pattern to find out if a certain key is forbidden for the registration of values to the test case data object;
13
+ basically, 'register_value' and all magic-method-alike keys are forbidden
14
+ """
15
+
8
16
 
9
17
  class TestCaseDataElementType:
10
18
  """
@@ -27,7 +35,14 @@ class TestCaseDataElementObject(TestCaseDataElementType):
27
35
  def register_value(self, key: str, value: Any):
28
36
  """
29
37
  Simply add the value as an attribute to the instance.
38
+
39
+ :param key: The key to register the value for
40
+ :param value: The value to register
41
+
42
+ :raises ValueError: If the key is forbidden for registration
30
43
  """
44
+ if FORBIDDEN_KEY_PATTERN.match(key):
45
+ raise ValueError(f"Key '{key}' is forbidden for the registration of values to the test case data object")
31
46
  setattr(self, key, value)
32
47
 
33
48
  def __getattribute__(self, name: str, /) -> Any: