From 9434541090d41caf6ac6ca2030ca8653a65ef74b Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Tue, 2 Apr 2019 17:36:52 +0200 Subject: [PATCH 1/3] doc: mention that pytest.fixture's param is in request.param --- src/_pytest/fixtures.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/_pytest/fixtures.py b/src/_pytest/fixtures.py index 0bb525a45..d6bceba02 100644 --- a/src/_pytest/fixtures.py +++ b/src/_pytest/fixtures.py @@ -1021,6 +1021,7 @@ def fixture(scope="function", params=None, autouse=False, ids=None, name=None): :arg params: an optional list of parameters which will cause multiple invocations of the fixture function and all of the tests using it. + The current parameter is available in ``request.param``. :arg autouse: if True, the fixture func is activated for all tests that can see it. If False (the default) then an explicit From db34bf01b635decb537bc3868b9221734aac430d Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Wed, 3 Apr 2019 00:22:09 +0200 Subject: [PATCH 2/3] doc: minor whitespace, punctuation --- doc/en/mark.rst | 6 ++---- doc/en/writing_plugins.rst | 1 - 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/doc/en/mark.rst b/doc/en/mark.rst index 5801dccde..ad9aaca4b 100644 --- a/doc/en/mark.rst +++ b/doc/en/mark.rst @@ -1,9 +1,7 @@ - .. _mark: Marking test functions with attributes -================================================================= - +====================================== By using the ``pytest.mark`` helper you can easily set metadata on your test functions. There are @@ -164,4 +162,4 @@ More details can be found in the `original PR Date: Wed, 3 Apr 2019 00:23:10 +0200 Subject: [PATCH 3/3] minor: check_interactive_exception: use Skipped --- src/_pytest/nose.py | 3 ++- src/_pytest/runner.py | 3 +-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/_pytest/nose.py b/src/_pytest/nose.py index 13dda68e7..492388260 100644 --- a/src/_pytest/nose.py +++ b/src/_pytest/nose.py @@ -7,6 +7,7 @@ import sys import six +import pytest from _pytest import python from _pytest import runner from _pytest import unittest @@ -26,7 +27,7 @@ def pytest_runtest_makereport(item, call): if call.excinfo and call.excinfo.errisinstance(get_skip_exceptions()): # let's substitute the excinfo with a pytest.skip one call2 = runner.CallInfo.from_call( - lambda: runner.skip(six.text_type(call.excinfo.value)), call.when + lambda: pytest.skip(six.text_type(call.excinfo.value)), call.when ) call.excinfo = call2.excinfo diff --git a/src/_pytest/runner.py b/src/_pytest/runner.py index 1f09f42e8..7fb343d4e 100644 --- a/src/_pytest/runner.py +++ b/src/_pytest/runner.py @@ -16,7 +16,6 @@ from .reports import CollectReport from .reports import TestReport from _pytest._code.code import ExceptionInfo from _pytest.outcomes import Exit -from _pytest.outcomes import skip from _pytest.outcomes import Skipped from _pytest.outcomes import TEST_OUTCOME @@ -183,7 +182,7 @@ def call_and_report(item, when, log=True, **kwds): def check_interactive_exception(call, report): return call.excinfo and not ( hasattr(report, "wasxfail") - or call.excinfo.errisinstance(skip.Exception) + or call.excinfo.errisinstance(Skipped) or call.excinfo.errisinstance(bdb.BdbQuit) )