pytest-plugins 0.3.8__tar.gz → 0.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 (31) hide show
  1. {pytest_plugins-0.3.8/pytest_plugins.egg-info → pytest_plugins-0.4.0}/PKG-INFO +1 -1
  2. {pytest_plugins-0.3.8 → pytest_plugins-0.4.0}/pytest_plugins/utils/helper.py +2 -0
  3. {pytest_plugins-0.3.8 → pytest_plugins-0.4.0/pytest_plugins.egg-info}/PKG-INFO +1 -1
  4. {pytest_plugins-0.3.8 → pytest_plugins-0.4.0}/setup.py +1 -1
  5. {pytest_plugins-0.3.8 → pytest_plugins-0.4.0}/LICENSE +0 -0
  6. {pytest_plugins-0.3.8 → pytest_plugins-0.4.0}/MANIFEST.in +0 -0
  7. {pytest_plugins-0.3.8 → pytest_plugins-0.4.0}/README.md +0 -0
  8. {pytest_plugins-0.3.8 → pytest_plugins-0.4.0}/pyproject.toml +0 -0
  9. {pytest_plugins-0.3.8 → pytest_plugins-0.4.0}/pytest_plugins/__init__.py +0 -0
  10. {pytest_plugins-0.3.8 → pytest_plugins-0.4.0}/pytest_plugins/add_config_parameters.py +0 -0
  11. {pytest_plugins-0.3.8 → pytest_plugins-0.4.0}/pytest_plugins/better_report.py +20 -20
  12. {pytest_plugins-0.3.8 → pytest_plugins-0.4.0}/pytest_plugins/fail2skip.py +0 -0
  13. {pytest_plugins-0.3.8 → pytest_plugins-0.4.0}/pytest_plugins/max_fail_streak.py +0 -0
  14. {pytest_plugins-0.3.8 → pytest_plugins-0.4.0}/pytest_plugins/models/__init__.py +0 -0
  15. {pytest_plugins-0.3.8 → pytest_plugins-0.4.0}/pytest_plugins/models/base_class_test.py +0 -0
  16. {pytest_plugins-0.3.8 → pytest_plugins-0.4.0}/pytest_plugins/models/environment_data.py +0 -0
  17. {pytest_plugins-0.3.8 → pytest_plugins-0.4.0}/pytest_plugins/models/execution_data.py +0 -0
  18. {pytest_plugins-0.3.8 → pytest_plugins-0.4.0}/pytest_plugins/models/status.py +0 -0
  19. {pytest_plugins-0.3.8 → pytest_plugins-0.4.0}/pytest_plugins/models/test_data.py +0 -0
  20. {pytest_plugins-0.3.8 → pytest_plugins-0.4.0}/pytest_plugins/utils/__init__.py +0 -0
  21. {pytest_plugins-0.3.8 → pytest_plugins-0.4.0}/pytest_plugins/utils/create_report.py +0 -0
  22. {pytest_plugins-0.3.8 → pytest_plugins-0.4.0}/pytest_plugins/utils/pytest_helper.py +0 -0
  23. {pytest_plugins-0.3.8 → pytest_plugins-0.4.0}/pytest_plugins/verbose_param_ids.py +0 -0
  24. {pytest_plugins-0.3.8 → pytest_plugins-0.4.0}/pytest_plugins.egg-info/SOURCES.txt +0 -0
  25. {pytest_plugins-0.3.8 → pytest_plugins-0.4.0}/pytest_plugins.egg-info/dependency_links.txt +0 -0
  26. {pytest_plugins-0.3.8 → pytest_plugins-0.4.0}/pytest_plugins.egg-info/entry_points.txt +0 -0
  27. {pytest_plugins-0.3.8 → pytest_plugins-0.4.0}/pytest_plugins.egg-info/requires.txt +0 -0
  28. {pytest_plugins-0.3.8 → pytest_plugins-0.4.0}/pytest_plugins.egg-info/top_level.txt +0 -0
  29. {pytest_plugins-0.3.8 → pytest_plugins-0.4.0}/requirements.txt +0 -0
  30. {pytest_plugins-0.3.8 → pytest_plugins-0.4.0}/setup.cfg +0 -0
  31. {pytest_plugins-0.3.8 → pytest_plugins-0.4.0}/tests/test_dummy.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pytest-plugins
3
- Version: 0.3.8
3
+ Version: 0.4.0
4
4
  Summary: A Python package for managing pytest plugins.
5
5
  Home-page: https://github.com/aviz92/pytest-plugins
6
6
  Author: Avi Zaguri
@@ -31,6 +31,8 @@ def serialize_data(obj: object) -> object: # default_serialize
31
31
  return obj.isoformat()
32
32
  if isinstance(obj, Decimal):
33
33
  return float(obj)
34
+ if isinstance(obj, Path):
35
+ return str(obj)
34
36
  logger.error(f'Object is not serializable: {obj}')
35
37
  raise TypeError(f"Type {type(obj)} not serializable")
36
38
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pytest-plugins
3
- Version: 0.3.8
3
+ Version: 0.4.0
4
4
  Summary: A Python package for managing pytest plugins.
5
5
  Home-page: https://github.com/aviz92/pytest-plugins
6
6
  Author: Avi Zaguri
@@ -1,6 +1,6 @@
1
1
  from setuptools import setup, find_packages
2
2
 
3
- package_version = '0.3.8'
3
+ package_version = '0.4.0'
4
4
 
5
5
  package_name = 'pytest-plugins'
6
6
  package_description = 'A Python package for managing pytest plugins.'
File without changes
File without changes
@@ -211,26 +211,6 @@ def session_setup_teardown(request: FixtureRequest) -> Generator[None, Any, None
211
211
  logger.info("Better report: Execution results saved")
212
212
 
213
213
 
214
- def pytest_runtest_teardown(item: Function) -> None:
215
- if not getattr(item.config, '_better_report_enabled', None):
216
- return
217
-
218
- test_full_name = get_test_full_name(item=item)
219
- test_item = test_results[test_full_name]
220
- if not test_item:
221
- logger.warning(f"Test {test_full_name} missing in test_results during teardown")
222
- return
223
-
224
- test_item.test_end_time = datetime.now(timezone.utc).isoformat()
225
- if test_item.test_start_time: # Add test duration only if start time is set
226
- try:
227
- start_obj = datetime.fromisoformat(test_item.test_start_time)
228
- end_obj = datetime.fromisoformat(test_item.test_end_time)
229
- test_item.test_duration_sec = (end_obj - start_obj).total_seconds()
230
- except Exception as e:
231
- logger.error(f"Error computing test duration for {test_full_name}: {e}")
232
-
233
-
234
214
  @pytest.hookimpl(hookwrapper=True, tryfirst=True)
235
215
  def pytest_runtest_makereport(item: Function, call: Any) -> Generator[None, Any, None]:
236
216
  outcome = yield
@@ -270,6 +250,26 @@ def pytest_runtest_makereport(item: Function, call: Any) -> Generator[None, Any,
270
250
  else:
271
251
  test_item.exception_message = None
272
252
 
253
+
254
+ def pytest_runtest_teardown(item: Function) -> None:
255
+ if not getattr(item.config, '_better_report_enabled', None):
256
+ return
257
+
258
+ test_full_name = get_test_full_name(item=item)
259
+ test_item = test_results[test_full_name]
260
+ if not test_item:
261
+ logger.warning(f"Test {test_full_name} missing in test_results during teardown")
262
+ return
263
+
264
+ test_item.test_end_time = datetime.now(timezone.utc).isoformat()
265
+ if test_item.test_start_time: # Add test duration only if start time is set
266
+ try:
267
+ start_obj = datetime.fromisoformat(test_item.test_start_time)
268
+ end_obj = datetime.fromisoformat(test_item.test_end_time)
269
+ test_item.test_duration_sec = (end_obj - start_obj).total_seconds()
270
+ except Exception as e:
271
+ logger.error(f"Error computing test duration for {test_full_name}: {e}")
272
+
273
273
  log_test_results(item=item, test_results=test_results)
274
274
 
275
275
 
File without changes