pytest-regtest 2.3.3__py3-none-any.whl → 2.3.4__py3-none-any.whl

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.
@@ -18,7 +18,6 @@ from .register_third_party_handlers import (
18
18
  register_pandas_handler,
19
19
  register_polars_handler,
20
20
  )
21
-
22
21
  from .snapshot_handler import register_python_object_handler
23
22
 
24
23
  __version__ = _version(__package__)
@@ -108,9 +108,6 @@ class PytestRegtestPlugin:
108
108
  if output_exception is not None:
109
109
  raise output_exception
110
110
 
111
- if item.get_closest_marker("xfail") and item.config.getvalue("--regtest-reset"):
112
- # enforce consistency with xfail:
113
- assert False
114
111
 
115
112
  def check_recorded_output(self, item):
116
113
  test_folder = item.fspath.dirname
@@ -127,6 +124,14 @@ class PytestRegtestPlugin:
127
124
  consider_line_endings = config.getvalue("--regtest-consider-line-endings")
128
125
  reset = config.getvalue("--regtest-reset")
129
126
 
127
+ # Skip reset for xfail tests that are actually expected to fail
128
+ xfail_marker = item.get_closest_marker("xfail")
129
+ if xfail_marker:
130
+ # Check if xfail condition evaluates to True
131
+ condition = xfail_marker.kwargs.get("condition", True)
132
+ if condition is True or (condition is not False and condition):
133
+ reset = False
134
+
130
135
  if reset:
131
136
  os.makedirs(os.path.dirname(recorded_output_path), exist_ok=True)
132
137
  with open(recorded_output_path + ".out", "w", encoding="utf-8") as fh:
@@ -252,9 +257,6 @@ class SnapshotPlugin:
252
257
  if snapshot_exception is not None:
253
258
  raise snapshot_exception
254
259
 
255
- if item.get_closest_marker("xfail") and item.config.getvalue("--regtest-reset"):
256
- # enforce fail
257
- assert False
258
260
 
259
261
  def check_snapshots(self, item):
260
262
  results = []
@@ -287,6 +289,14 @@ class SnapshotPlugin:
287
289
 
288
290
  reset = config.getvalue("--regtest-reset")
289
291
 
292
+ # Skip reset for xfail tests that are actually expected to fail
293
+ xfail_marker = item.get_closest_marker("xfail")
294
+ if xfail_marker:
295
+ # Check if xfail condition evaluates to True
296
+ condition = xfail_marker.kwargs.get("condition", True)
297
+ if condition is True or (condition is not False and condition):
298
+ reset = False
299
+
290
300
  if reset:
291
301
  os.makedirs(recorded_output_path, exist_ok=True)
292
302
  handler.save(recorded_output_path, obj)
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.4
2
2
  Name: pytest-regtest
3
- Version: 2.3.3
3
+ Version: 2.3.4
4
4
  Summary: pytest plugin for snapshot regression testing
5
5
  Author-email: Uwe Schmitt <uwe.schmitt@id.ethz.ch>
6
6
  License: MIT License
@@ -14,7 +14,29 @@ Classifier: Programming Language :: Python :: 3.12
14
14
  Classifier: License :: OSI Approved :: MIT License
15
15
  Description-Content-Type: text/markdown
16
16
  License-File: LICENSE.txt
17
- Requires-Dist: pytest >7.2
17
+ Requires-Dist: pytest>7.2
18
+ Provides-Extra: dev
19
+ Requires-Dist: twine; extra == "dev"
20
+ Requires-Dist: build; extra == "dev"
21
+ Requires-Dist: hatchling; extra == "dev"
22
+ Requires-Dist: wheel; extra == "dev"
23
+ Requires-Dist: pre-commit; extra == "dev"
24
+ Requires-Dist: ruff; extra == "dev"
25
+ Requires-Dist: black; extra == "dev"
26
+ Requires-Dist: pytest-cov; extra == "dev"
27
+ Requires-Dist: numpy; extra == "dev"
28
+ Requires-Dist: pandas; extra == "dev"
29
+ Requires-Dist: mkdocs; extra == "dev"
30
+ Requires-Dist: mkdocs-material; extra == "dev"
31
+ Requires-Dist: mistletoe; extra == "dev"
32
+ Requires-Dist: mkdocs-awesome-pages-plugin; extra == "dev"
33
+ Requires-Dist: jinja2-cli; extra == "dev"
34
+ Requires-Dist: mkdocstrings[python]; extra == "dev"
35
+ Requires-Dist: numpy>=2; extra == "dev"
36
+ Requires-Dist: pandas>=2; extra == "dev"
37
+ Requires-Dist: polars>=1.9; extra == "dev"
38
+ Requires-Dist: md-transformer>=0.0.3; extra == "dev"
39
+ Dynamic: license-file
18
40
 
19
41
  ![](https://gitlab.com/uweschmitt/pytest-regtest/badges/main/pipeline.svg)
20
42
  ![](https://gitlab.com/uweschmitt/pytest-regtest/badges/main/coverage.svg?job=coverage)
@@ -0,0 +1,14 @@
1
+ pytest_regtest/__init__.py,sha256=GiURR8QAsu7GAVtbBEnwr1nNIcemLlcX7H5APQCb1ok,2535
2
+ pytest_regtest/numpy_handler.py,sha256=hKrVY9dId-45rUR_83w9jbUWgUhd0ABk8uLbOhgm0IM,7173
3
+ pytest_regtest/pandas_handler.py,sha256=7vKaHyODcKMltgn9MbbbL1FsOBQK994dEY5fVlDoQ1g,4528
4
+ pytest_regtest/polars_handler.py,sha256=G25GmzZo95MzHoehvKXiv-SV8TkKA4TnLEqQ-nZa3d8,3796
5
+ pytest_regtest/pytest_regtest.py,sha256=MoKUuwG2hZGmJApuhgGN0PTVC4nRRk06MMknNEtZchc,22899
6
+ pytest_regtest/register_third_party_handlers.py,sha256=mfmcyeMKuxFykkKLO7T1Tz5RPitn1pKLYRM7B9lA1Kg,1132
7
+ pytest_regtest/snapshot_handler.py,sha256=MbWpNYOSkhQRs6U0qLT1kz5CV6JCay26yHntju8h9uU,6046
8
+ pytest_regtest/utils.py,sha256=2jYTlV_qL5hH6FCeg7T1HJJvKual-Kux2scJ9_aB1lY,811
9
+ pytest_regtest-2.3.4.dist-info/licenses/LICENSE.txt,sha256=Tue36uAzpW79-9WAqzkwPhsDDVd1X-VWUmdZ0MfGYvk,1068
10
+ pytest_regtest-2.3.4.dist-info/METADATA,sha256=lfwb5DvwQoZ_iR2eykuhf_PVL0AQ-MTCsF02Y8h6ABY,4157
11
+ pytest_regtest-2.3.4.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
12
+ pytest_regtest-2.3.4.dist-info/entry_points.txt,sha256=4VuIhXeMGhDo0ATbaUfyjND0atofmZjV_P-o6_uEk2s,36
13
+ pytest_regtest-2.3.4.dist-info/top_level.txt,sha256=vnqUV6AhbIRzZqEfkFhZBBSMoo-tvRkYGeo4KKida1U,15
14
+ pytest_regtest-2.3.4.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (75.4.0)
2
+ Generator: setuptools (80.9.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -1,14 +0,0 @@
1
- pytest_regtest/__init__.py,sha256=q3wEEi3ZZXaN5CXc0jKCeupbAl73t64Fz1pFNcYYPYo,2536
2
- pytest_regtest/numpy_handler.py,sha256=hKrVY9dId-45rUR_83w9jbUWgUhd0ABk8uLbOhgm0IM,7173
3
- pytest_regtest/pandas_handler.py,sha256=7vKaHyODcKMltgn9MbbbL1FsOBQK994dEY5fVlDoQ1g,4528
4
- pytest_regtest/polars_handler.py,sha256=G25GmzZo95MzHoehvKXiv-SV8TkKA4TnLEqQ-nZa3d8,3796
5
- pytest_regtest/pytest_regtest.py,sha256=anNCLTTRwe5dy7i_kcrLzeaiP1CskLDevn9FxYdAMJ4,22432
6
- pytest_regtest/register_third_party_handlers.py,sha256=mfmcyeMKuxFykkKLO7T1Tz5RPitn1pKLYRM7B9lA1Kg,1132
7
- pytest_regtest/snapshot_handler.py,sha256=MbWpNYOSkhQRs6U0qLT1kz5CV6JCay26yHntju8h9uU,6046
8
- pytest_regtest/utils.py,sha256=2jYTlV_qL5hH6FCeg7T1HJJvKual-Kux2scJ9_aB1lY,811
9
- pytest_regtest-2.3.3.dist-info/LICENSE.txt,sha256=Tue36uAzpW79-9WAqzkwPhsDDVd1X-VWUmdZ0MfGYvk,1068
10
- pytest_regtest-2.3.3.dist-info/METADATA,sha256=JWpJlvyy6SttnRPRePup4ySvc4MZS92LjuPDwWC8aCc,3276
11
- pytest_regtest-2.3.3.dist-info/WHEEL,sha256=a7TGlA-5DaHMRrarXjVbQagU3Man_dCnGIWMJr5kRWo,91
12
- pytest_regtest-2.3.3.dist-info/entry_points.txt,sha256=4VuIhXeMGhDo0ATbaUfyjND0atofmZjV_P-o6_uEk2s,36
13
- pytest_regtest-2.3.3.dist-info/top_level.txt,sha256=vnqUV6AhbIRzZqEfkFhZBBSMoo-tvRkYGeo4KKida1U,15
14
- pytest_regtest-2.3.3.dist-info/RECORD,,