pytest-regtest 2.3.4__py3-none-any.whl → 2.3.5__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.
@@ -145,8 +145,7 @@ class NumpyHandler(BaseSnapshotHandler):
145
145
  " entries"
146
146
  )
147
147
  lines.append(
148
- f"up to given precision settings rtol={self.rtol:e} and"
149
- f" atol={self.atol:e}"
148
+ f"up to given precision settings rtol={self.rtol:e} and atol={self.atol:e}"
150
149
  )
151
150
 
152
151
  return lines
@@ -75,21 +75,16 @@ class DataFrameHandler(BaseSnapshotHandler):
75
75
  def extract(df, selector):
76
76
  return df[[n for (n, t) in zip(df.columns, df.dtypes) if selector(t)]]
77
77
 
78
- current_reduced_floats = extract(
79
- current_reduced, lambda t: t.type is np.float64
80
- ).to_numpy()
78
+ def is_float(t):
79
+ return t.type in (np.float64, np.float32)
81
80
 
82
- current_reduced_other = extract(
83
- current_reduced, lambda t: t.type is not np.float64
84
- )
81
+ current_reduced_floats = extract(current_reduced, is_float).to_numpy()
85
82
 
86
- recorded_reduced_floats = extract(
87
- recorded_reduced, lambda t: t.type is np.float64
88
- ).to_numpy()
83
+ current_reduced_other = extract(current_reduced, lambda t: not is_float(t))
89
84
 
90
- recorded_reduced_other = extract(
91
- recorded_reduced, lambda t: t.type is not np.float64
92
- )
85
+ recorded_reduced_floats = extract(recorded_reduced, is_float).to_numpy()
86
+
87
+ recorded_reduced_other = extract(recorded_reduced, lambda t: not is_float(t))
93
88
 
94
89
  return np.allclose(
95
90
  current_reduced_floats,
@@ -97,7 +92,7 @@ class DataFrameHandler(BaseSnapshotHandler):
97
92
  atol=self.atol,
98
93
  rtol=self.rtol,
99
94
  equal_nan=True,
100
- ) and (current_reduced_other == recorded_reduced_other).all(axis=None)
95
+ ) and current_reduced_other.equals(recorded_reduced_other)
101
96
 
102
97
  def show_differences(self, current, recorded, has_markup):
103
98
  lines = []
@@ -108,7 +108,6 @@ class PytestRegtestPlugin:
108
108
  if output_exception is not None:
109
109
  raise output_exception
110
110
 
111
-
112
111
  def check_recorded_output(self, item):
113
112
  test_folder = item.fspath.dirname
114
113
  regtest_stream = item.regtest_stream
@@ -257,7 +256,6 @@ class SnapshotPlugin:
257
256
  if snapshot_exception is not None:
258
257
  raise snapshot_exception
259
258
 
260
-
261
259
  def check_snapshots(self, item):
262
260
  results = []
263
261
 
@@ -1,9 +1,9 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pytest-regtest
3
- Version: 2.3.4
3
+ Version: 2.3.5
4
4
  Summary: pytest plugin for snapshot regression testing
5
5
  Author-email: Uwe Schmitt <uwe.schmitt@id.ethz.ch>
6
- License: MIT License
6
+ License-Expression: MIT
7
7
  Project-URL: Source, https://gitlab.com/uweschmitt/pytest-regtest
8
8
  Project-URL: Documentation, https://pytest-regtest.readthedocs.org
9
9
  Classifier: Intended Audience :: Developers
@@ -11,31 +11,9 @@ Classifier: Programming Language :: Python :: 3.9
11
11
  Classifier: Programming Language :: Python :: 3.10
12
12
  Classifier: Programming Language :: Python :: 3.11
13
13
  Classifier: Programming Language :: Python :: 3.12
14
- Classifier: License :: OSI Approved :: MIT License
15
14
  Description-Content-Type: text/markdown
16
15
  License-File: LICENSE.txt
17
16
  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
17
  Dynamic: license-file
40
18
 
41
19
  ![](https://gitlab.com/uweschmitt/pytest-regtest/badges/main/pipeline.svg)
@@ -0,0 +1,14 @@
1
+ pytest_regtest/__init__.py,sha256=GiURR8QAsu7GAVtbBEnwr1nNIcemLlcX7H5APQCb1ok,2535
2
+ pytest_regtest/numpy_handler.py,sha256=iuCN4fPr8ldEPeS5henmfmGg7nhFDjLMisgwotpm5rA,7157
3
+ pytest_regtest/pandas_handler.py,sha256=iDo5i5nSAYVWlOAps3pB3cbJmRvq1gHsWBF5y8f2M2c,4446
4
+ pytest_regtest/polars_handler.py,sha256=G25GmzZo95MzHoehvKXiv-SV8TkKA4TnLEqQ-nZa3d8,3796
5
+ pytest_regtest/pytest_regtest.py,sha256=c6k2NV-yWOecf4AjGgP1k_1oNXf5XD65aqqLYmRB5R8,22897
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.5.dist-info/licenses/LICENSE.txt,sha256=Tue36uAzpW79-9WAqzkwPhsDDVd1X-VWUmdZ0MfGYvk,1068
10
+ pytest_regtest-2.3.5.dist-info/METADATA,sha256=iMW7--UXXOHC0LILMuzLpF1BK3kCxph0rOkEUHRnS3U,3249
11
+ pytest_regtest-2.3.5.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
12
+ pytest_regtest-2.3.5.dist-info/entry_points.txt,sha256=4VuIhXeMGhDo0ATbaUfyjND0atofmZjV_P-o6_uEk2s,36
13
+ pytest_regtest-2.3.5.dist-info/top_level.txt,sha256=vnqUV6AhbIRzZqEfkFhZBBSMoo-tvRkYGeo4KKida1U,15
14
+ pytest_regtest-2.3.5.dist-info/RECORD,,
@@ -1,14 +0,0 @@
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,,