pytest-exit-code 0.1.0__py3-none-any.whl → 0.2.0__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.
@@ -7,3 +7,5 @@ class ExitCode(IntFlag):
7
7
  TESTS_FAILED = 2
8
8
  TESTS_ERRORED = 4
9
9
  TESTS_SKIPPED = 8
10
+ TESTS_XFAILED = 16
11
+ TESTS_XPASSED = 32
@@ -12,7 +12,10 @@ class ExitCodePlugin:
12
12
  @pytest.hookimpl
13
13
  def pytest_runtest_logreport(self, report: pytest.TestReport) -> None:
14
14
  if report.passed and report.when in ["call"]:
15
- self.exit_code |= ExitCode.TESTS_PASSED
15
+ if hasattr(report, "wasxfail"):
16
+ self.exit_code |= ExitCode.TESTS_XPASSED
17
+ else:
18
+ self.exit_code |= ExitCode.TESTS_PASSED
16
19
 
17
20
  if report.failed:
18
21
  if report.when in ["setup", "teardown"]:
@@ -21,7 +24,10 @@ class ExitCodePlugin:
21
24
  self.exit_code |= ExitCode.TESTS_FAILED
22
25
 
23
26
  if report.skipped:
24
- self.exit_code |= ExitCode.TESTS_SKIPPED
27
+ if hasattr(report, "wasxfail"):
28
+ self.exit_code |= ExitCode.TESTS_XFAILED
29
+ else:
30
+ self.exit_code |= ExitCode.TESTS_SKIPPED
25
31
 
26
32
  @pytest.hookimpl
27
33
  def pytest_sessionfinish(self, session: pytest.Session):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pytest-exit-code
3
- Version: 0.1.0
3
+ Version: 0.2.0
4
4
  Summary: A pytest plugin that overrides the built-in exit codes to retain more information about the test results.
5
5
  Author-email: Sander Ploegsma <sanderploegsma@gmail.com>
6
6
  Maintainer-email: Sander Ploegsma <sanderploegsma@gmail.com>
@@ -235,7 +235,7 @@ A [pytest] plugin that overrides the built-in exit codes to retain more informat
235
235
  ## Features
236
236
 
237
237
  This plugin changes the exit code returned by running `pytest`.
238
- The exit codes can range from `0` to `15` and are a combination of the following bitwise flags:
238
+ The exit codes can range from `0` to `63` and are a combination of the following bitwise flags:
239
239
 
240
240
  | Flag | Description |
241
241
  | ---- | ------------------------------- |
@@ -244,6 +244,8 @@ The exit codes can range from `0` to `15` and are a combination of the following
244
244
  | `2` | One or more tests failed. |
245
245
  | `4` | One or more tests errored. |
246
246
  | `8` | One or more tests were skipped. |
247
+ | `16` | One or more tests xfailed. |
248
+ | `32` | One or more tests xpassed. |
247
249
 
248
250
  So:
249
251
 
@@ -0,0 +1,8 @@
1
+ pytest_exit_code/__init__.py,sha256=FSDiYIXh1fTl3uczg6M7-o3yV55p4nT-BhG_PL-cz74,203
2
+ pytest_exit_code/plugin.py,sha256=-tlzooEwayjbisOidu-v7PI8UUMQ2UqbEn1buah1O4I,1527
3
+ pytest_exit_code-0.2.0.dist-info/LICENSE,sha256=CUvt2ilcBwKAfRAnoA4RNPTLcdUj3En21LPK9YkFMGg,11358
4
+ pytest_exit_code-0.2.0.dist-info/METADATA,sha256=RdLZW7qeed-fhUwSmaCk6F2O5cPVQ-HRLG7s3U-DKfE,16017
5
+ pytest_exit_code-0.2.0.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
6
+ pytest_exit_code-0.2.0.dist-info/entry_points.txt,sha256=xxC_jsE6gBe61UgtLIv6mdUvsv4NldUR39IDel0QPwA,44
7
+ pytest_exit_code-0.2.0.dist-info/top_level.txt,sha256=cOcgV4pYixUt8MZTdeZz79wb1jTLTC7UbTI9-2bL-aQ,17
8
+ pytest_exit_code-0.2.0.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: bdist_wheel (0.42.0)
2
+ Generator: bdist_wheel (0.43.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -1,8 +0,0 @@
1
- pytest_exit_code/__init__.py,sha256=Y4XFT02jDVwKJ2VIO3IINh_qyKzpAH4fIduM5mNca-s,157
2
- pytest_exit_code/plugin.py,sha256=lmm0auzLf-ESkFdvRiQIcjGTCTVsQeC-6FvgLoUDU4I,1281
3
- pytest_exit_code-0.1.0.dist-info/LICENSE,sha256=CUvt2ilcBwKAfRAnoA4RNPTLcdUj3En21LPK9YkFMGg,11358
4
- pytest_exit_code-0.1.0.dist-info/METADATA,sha256=-B8YIcQJ2xoPipxgYXD767LFG9wJ5DZujYkD9o9-N98,15931
5
- pytest_exit_code-0.1.0.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
6
- pytest_exit_code-0.1.0.dist-info/entry_points.txt,sha256=xxC_jsE6gBe61UgtLIv6mdUvsv4NldUR39IDel0QPwA,44
7
- pytest_exit_code-0.1.0.dist-info/top_level.txt,sha256=cOcgV4pYixUt8MZTdeZz79wb1jTLTC7UbTI9-2bL-aQ,17
8
- pytest_exit_code-0.1.0.dist-info/RECORD,,