tests: runner: improve/ignore coverage (#6781)
This commit is contained in:
parent
4c9b850e13
commit
b099fcfa33
|
@ -382,7 +382,7 @@ class BaseFunctionalTests:
|
||||||
"""
|
"""
|
||||||
)
|
)
|
||||||
except SystemExit:
|
except SystemExit:
|
||||||
pytest.fail("runner did not catch SystemExit")
|
assert False, "runner did not catch SystemExit"
|
||||||
rep = reports[1]
|
rep = reports[1]
|
||||||
assert rep.failed
|
assert rep.failed
|
||||||
assert rep.when == "call"
|
assert rep.when == "call"
|
||||||
|
@ -399,7 +399,7 @@ class BaseFunctionalTests:
|
||||||
except pytest.exit.Exception:
|
except pytest.exit.Exception:
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
pytest.fail("did not raise")
|
assert False, "did not raise"
|
||||||
|
|
||||||
|
|
||||||
class TestExecutionNonForked(BaseFunctionalTests):
|
class TestExecutionNonForked(BaseFunctionalTests):
|
||||||
|
@ -420,7 +420,7 @@ class TestExecutionNonForked(BaseFunctionalTests):
|
||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
pytest.fail("did not raise")
|
assert False, "did not raise"
|
||||||
|
|
||||||
|
|
||||||
class TestExecutionForked(BaseFunctionalTests):
|
class TestExecutionForked(BaseFunctionalTests):
|
||||||
|
@ -735,9 +735,9 @@ def test_importorskip(monkeypatch) -> None:
|
||||||
pytest.importorskip("hello123", minversion="1.3.1")
|
pytest.importorskip("hello123", minversion="1.3.1")
|
||||||
mod2 = pytest.importorskip("hello123", minversion="1.3")
|
mod2 = pytest.importorskip("hello123", minversion="1.3")
|
||||||
assert mod2 == mod
|
assert mod2 == mod
|
||||||
except pytest.skip.Exception:
|
except pytest.skip.Exception: # pragma: no cover
|
||||||
raise NotImplementedError(
|
assert False, "spurious skip: {}".format(
|
||||||
"spurious skip: {}".format(_pytest._code.ExceptionInfo.from_current())
|
_pytest._code.ExceptionInfo.from_current()
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@ -755,9 +755,9 @@ def test_importorskip_dev_module(monkeypatch) -> None:
|
||||||
assert mod2 == mod
|
assert mod2 == mod
|
||||||
with pytest.raises(pytest.skip.Exception):
|
with pytest.raises(pytest.skip.Exception):
|
||||||
pytest.importorskip("mockmodule1", minversion="0.14.0")
|
pytest.importorskip("mockmodule1", minversion="0.14.0")
|
||||||
except pytest.skip.Exception:
|
except pytest.skip.Exception: # pragma: no cover
|
||||||
raise NotImplementedError(
|
assert False, "spurious skip: {}".format(
|
||||||
"spurious skip: {}".format(_pytest._code.ExceptionInfo.from_current())
|
_pytest._code.ExceptionInfo.from_current()
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue