Skip to content

Commit

Permalink
Merge pull request #19 from NiklasRosenstein/fix-12
Browse files Browse the repository at this point in the history
fix #12 by stripping "x" from the test outcome
  • Loading branch information
NiklasRosenstein committed Aug 9, 2021
2 parents 0deb5e5 + 7566b54 commit 7e5bd23
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
7 changes: 7 additions & 0 deletions .changelog/_unreleased.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
release_date: null
changes:
- type: fix
component: general
description: fix missing import for `typing.Dict` in `pytest` driver module, which
could in some Python versions result in a `NameError`
fixes: []
4 changes: 2 additions & 2 deletions src/shut/test/pytest.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import os
import subprocess as sp
import sys
from typing import List, Optional, Tuple, TYPE_CHECKING
from typing import Dict, List, Optional, Tuple, TYPE_CHECKING

from databind.core import datamodel, field
from nr.parsing.date import timezone # type: ignore
Expand Down Expand Up @@ -78,7 +78,7 @@ def load_report_file(report_file: str) -> TestRun:
else:
crash = None
stdout = None
test_status = {'passed': TestStatus.PASSED, 'failed': TestStatus.FAILED, 'skipped': TestStatus.SKIPPED}[test['outcome']]
test_status = {'passed': TestStatus.PASSED, 'failed': TestStatus.FAILED, 'skipped': TestStatus.SKIPPED}[test['outcome'].lstrip('x')]
tests.append(TestCase(
name=test['nodeid'],
duration=sum(test[k]['duration'] for k in ('setup', 'call', 'teardown') if k in test),
Expand Down
11 changes: 11 additions & 0 deletions src/test/test_test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@

"""
This module uses some pytest features that should all work when using the pytest driver with `shut pkg test`.
"""

import pytest


@pytest.mark.xfail
def test_xfail():
pass

0 comments on commit 7e5bd23

Please sign in to comment.