pytest-plugins 0.4.1__tar.gz → 0.4.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.
Files changed (31) hide show
  1. {pytest_plugins-0.4.1/pytest_plugins.egg-info → pytest_plugins-0.4.3}/PKG-INFO +1 -1
  2. {pytest_plugins-0.4.1 → pytest_plugins-0.4.3}/pytest_plugins/better_report.py +13 -4
  3. {pytest_plugins-0.4.1 → pytest_plugins-0.4.3}/pytest_plugins/models/test_data.py +1 -1
  4. {pytest_plugins-0.4.1 → pytest_plugins-0.4.3/pytest_plugins.egg-info}/PKG-INFO +1 -1
  5. {pytest_plugins-0.4.1 → pytest_plugins-0.4.3}/setup.py +1 -1
  6. {pytest_plugins-0.4.1 → pytest_plugins-0.4.3}/tests/test_dummy.py +28 -1
  7. {pytest_plugins-0.4.1 → pytest_plugins-0.4.3}/LICENSE +0 -0
  8. {pytest_plugins-0.4.1 → pytest_plugins-0.4.3}/MANIFEST.in +0 -0
  9. {pytest_plugins-0.4.1 → pytest_plugins-0.4.3}/README.md +0 -0
  10. {pytest_plugins-0.4.1 → pytest_plugins-0.4.3}/pyproject.toml +0 -0
  11. {pytest_plugins-0.4.1 → pytest_plugins-0.4.3}/pytest_plugins/__init__.py +0 -0
  12. {pytest_plugins-0.4.1 → pytest_plugins-0.4.3}/pytest_plugins/add_config_parameters.py +0 -0
  13. {pytest_plugins-0.4.1 → pytest_plugins-0.4.3}/pytest_plugins/fail2skip.py +0 -0
  14. {pytest_plugins-0.4.1 → pytest_plugins-0.4.3}/pytest_plugins/max_fail_streak.py +0 -0
  15. {pytest_plugins-0.4.1 → pytest_plugins-0.4.3}/pytest_plugins/models/__init__.py +0 -0
  16. {pytest_plugins-0.4.1 → pytest_plugins-0.4.3}/pytest_plugins/models/base_class_test.py +0 -0
  17. {pytest_plugins-0.4.1 → pytest_plugins-0.4.3}/pytest_plugins/models/environment_data.py +0 -0
  18. {pytest_plugins-0.4.1 → pytest_plugins-0.4.3}/pytest_plugins/models/execution_data.py +0 -0
  19. {pytest_plugins-0.4.1 → pytest_plugins-0.4.3}/pytest_plugins/models/status.py +0 -0
  20. {pytest_plugins-0.4.1 → pytest_plugins-0.4.3}/pytest_plugins/utils/__init__.py +0 -0
  21. {pytest_plugins-0.4.1 → pytest_plugins-0.4.3}/pytest_plugins/utils/create_report.py +0 -0
  22. {pytest_plugins-0.4.1 → pytest_plugins-0.4.3}/pytest_plugins/utils/helper.py +0 -0
  23. {pytest_plugins-0.4.1 → pytest_plugins-0.4.3}/pytest_plugins/utils/pytest_helper.py +0 -0
  24. {pytest_plugins-0.4.1 → pytest_plugins-0.4.3}/pytest_plugins/verbose_param_ids.py +0 -0
  25. {pytest_plugins-0.4.1 → pytest_plugins-0.4.3}/pytest_plugins.egg-info/SOURCES.txt +0 -0
  26. {pytest_plugins-0.4.1 → pytest_plugins-0.4.3}/pytest_plugins.egg-info/dependency_links.txt +0 -0
  27. {pytest_plugins-0.4.1 → pytest_plugins-0.4.3}/pytest_plugins.egg-info/entry_points.txt +0 -0
  28. {pytest_plugins-0.4.1 → pytest_plugins-0.4.3}/pytest_plugins.egg-info/requires.txt +0 -0
  29. {pytest_plugins-0.4.1 → pytest_plugins-0.4.3}/pytest_plugins.egg-info/top_level.txt +0 -0
  30. {pytest_plugins-0.4.1 → pytest_plugins-0.4.3}/requirements.txt +0 -0
  31. {pytest_plugins-0.4.1 → pytest_plugins-0.4.3}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pytest-plugins
3
- Version: 0.4.1
3
+ Version: 0.4.3
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
@@ -197,8 +197,9 @@ def session_setup_teardown(request: FixtureRequest) -> Generator[None, Any, None
197
197
 
198
198
  # update execution status
199
199
  exec_info.execution_status = (
200
- ExecutionStatus.PASSED if all(t.test_status == ExecutionStatus.PASSED for t in test_results.values())
201
- else ExecutionStatus.FAILED
200
+ ExecutionStatus.PASSED if all(
201
+ t.test_status in [ExecutionStatus.PASSED, ExecutionStatus.SKIPPED] for t in test_results.values()
202
+ ) else ExecutionStatus.FAILED
202
203
  )
203
204
 
204
205
  exec_info.test_list = list(test_results.keys())
@@ -213,18 +214,26 @@ def session_setup_teardown(request: FixtureRequest) -> Generator[None, Any, None
213
214
 
214
215
  @pytest.hookimpl(hookwrapper=True, tryfirst=True)
215
216
  def pytest_runtest_makereport(item: Function, call: Any) -> Generator[None, Any, None]:
217
+ if not getattr(item.config, '_better_report_enabled', None):
218
+ logger.debug("Better report plugin is not enabled, skipping session start processing")
219
+ return
220
+
221
+ test_full_name = get_test_full_name(item=item)
222
+ test_item = test_results.get(test_full_name)
223
+
216
224
  if call.when == "setup":
217
225
  test_full_name = get_test_full_name(item=item)
218
226
  test_results[test_full_name].test_start_time = datetime.now(timezone.utc).isoformat()
219
227
 
228
+ if call.excinfo and call.excinfo.typename == ExecutionStatus.SKIPPED.value.title():
229
+ test_item.test_status = ExecutionStatus.SKIPPED
230
+
220
231
  outcome = yield
221
232
  report = outcome.get_result()
222
233
 
223
234
  if report.when != "call" or not getattr(item.config, '_better_report_enabled', None):
224
235
  return
225
236
 
226
- test_full_name = get_test_full_name(item=item)
227
- test_item = test_results.get(test_full_name)
228
237
  if not test_item:
229
238
  logger.warning(f"Test {test_full_name} missing in test_results during makereport")
230
239
  return
@@ -17,6 +17,6 @@ class TestData:
17
17
  test_markers: Optional[list] = None
18
18
  test_start_time: Optional[str] = None
19
19
  test_end_time: Optional[str] = None
20
- test_duration_sec: Optional[float] = None
20
+ test_duration_sec: Optional[float] = None # only for the tst itself, not including fixtures
21
21
  exception_message: Optional[str] = None
22
22
  run_index: Optional[int] = None
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pytest-plugins
3
- Version: 0.4.1
3
+ Version: 0.4.3
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.4.1'
3
+ package_version = '0.4.3'
4
4
 
5
5
  package_name = 'pytest-plugins'
6
6
  package_description = 'A Python package for managing pytest plugins.'
@@ -5,9 +5,16 @@ parametrize = pytest.mark.parametrize(
5
5
  )
6
6
 
7
7
 
8
+ @pytest.fixture(scope="session")
9
+ def print_x():
10
+ """Fixture that runs before any tests in the session."""
11
+ print("Running setup for the test session.")
12
+ yield
13
+ print("Running teardown for the test session.")
14
+
8
15
  class TestDummy:
9
16
  @pytest.mark.test_pass
10
- def test_pass(self):
17
+ def test_pass(self, print_x):
11
18
  assert True
12
19
 
13
20
  @pytest.mark.test_fail
@@ -29,3 +36,23 @@ class TestDummy:
29
36
  @pytest.mark.parametrize("param1, param2", [(1, 1), (2, 2), (3, 3), (4, 5)])
30
37
  def test_with_parameters_2(self, param1, param2):
31
38
  assert param1 != param2
39
+
40
+
41
+ def test_dummy_1():
42
+ """A dummy test to ensure pytest is working."""
43
+ assert True, "This is a dummy test 1 to ensure pytest is working."
44
+
45
+
46
+ @pytest.mark.skip
47
+ def test_dummy_2():
48
+ """A dummy test to ensure pytest is working."""
49
+ assert True, "This is a dummy test 2 to ensure pytest is working."
50
+
51
+
52
+ @pytest.mark.skip
53
+ class TestDummy2:
54
+ def test_pass(self, print_x):
55
+ assert True
56
+
57
+ def test_pass2(self, print_x):
58
+ assert True
File without changes
File without changes
File without changes