3 new commits in pytest: https://bitbucket.org/pytest-dev/pytest/commits/79264aa5deef/ Changeset: 79264aa5deef Branch: reintroduce_pytest_fixture User: hpk42 Date: 2015-04-22 15:06:00+00:00 Summary: reintroduced _pytest fixture of the pytester plugin which is used at least by pytest-xdist. Affected #: 2 files
diff -r b89271e4512145c7a723a49ac760ee39240531f5 -r 79264aa5deef8260da334006f0866ff4a423f1cf CHANGELOG --- a/CHANGELOG +++ b/CHANGELOG @@ -24,6 +24,8 @@ - fixed regression to 2.6.4 which surfaced e.g. in lost stdout capture printing when tests raised SystemExit. Thanks Holger Krekel. +- reintroduced _pytest fixture of the pytester plugin which is used + at least by pytest-xdist. 2.7.0 (compared to 2.6.4) ----------------------------- diff -r b89271e4512145c7a723a49ac760ee39240531f5 -r 79264aa5deef8260da334006f0866ff4a423f1cf _pytest/pytester.py --- a/_pytest/pytester.py +++ b/_pytest/pytester.py @@ -15,6 +15,19 @@ from _pytest.main import Session, EXIT_OK +# used at least by pytest-xdist plugin +def pytest_funcarg___pytest(request): + return PytestArg(request) + +class PytestArg: + def __init__(self, request): + self.request = request + + def gethookrecorder(self, hook): + hookrecorder = HookRecorder(hook._pm) + self.request.addfinalizer(hookrecorder.finish_recording) + return hookrecorder + def get_public_names(l): """Only return names from iterator l without a leading underscore.""" https://bitbucket.org/pytest-dev/pytest/commits/1cb853615ad8/ Changeset: 1cb853615ad8 Branch: reintroduce_pytest_fixture User: hpk42 Date: 2015-04-22 19:04:36+00:00 Summary: accomodate Floris' comments. (The reason was i just reinstanted the old code :) Affected #: 1 file diff -r 79264aa5deef8260da334006f0866ff4a423f1cf -r 1cb853615ad8b9dfba6ae6651b9323e660064b55 _pytest/pytester.py --- a/_pytest/pytester.py +++ b/_pytest/pytester.py @@ -16,7 +16,12 @@ from _pytest.main import Session, EXIT_OK # used at least by pytest-xdist plugin -def pytest_funcarg___pytest(request): +@pytest.fixture +def _pytest(request): + """ Return a helper which offers a gethookrecorder(hook) + method which returns a HookRecorder instance which helps + to make assertions about called hooks. + """ return PytestArg(request) class PytestArg: https://bitbucket.org/pytest-dev/pytest/commits/6f7fb5f6a382/ Changeset: 6f7fb5f6a382 Branch: pytest-2.7 User: flub Date: 2015-04-22 23:52:13+00:00 Summary: Merged in hpk42/pytest-patches/reintroduce_pytest_fixture (pull request #279) reintroduced _pytest fixture of the pytester plugin Affected #: 2 files diff -r b89271e4512145c7a723a49ac760ee39240531f5 -r 6f7fb5f6a3822d0736eb3c0ac405441c17705940 CHANGELOG --- a/CHANGELOG +++ b/CHANGELOG @@ -24,6 +24,8 @@ - fixed regression to 2.6.4 which surfaced e.g. in lost stdout capture printing when tests raised SystemExit. Thanks Holger Krekel. +- reintroduced _pytest fixture of the pytester plugin which is used + at least by pytest-xdist. 2.7.0 (compared to 2.6.4) ----------------------------- diff -r b89271e4512145c7a723a49ac760ee39240531f5 -r 6f7fb5f6a3822d0736eb3c0ac405441c17705940 _pytest/pytester.py --- a/_pytest/pytester.py +++ b/_pytest/pytester.py @@ -15,6 +15,24 @@ from _pytest.main import Session, EXIT_OK +# used at least by pytest-xdist plugin +@pytest.fixture +def _pytest(request): + """ Return a helper which offers a gethookrecorder(hook) + method which returns a HookRecorder instance which helps + to make assertions about called hooks. + """ + return PytestArg(request) + +class PytestArg: + def __init__(self, request): + self.request = request + + def gethookrecorder(self, hook): + hookrecorder = HookRecorder(hook._pm) + self.request.addfinalizer(hookrecorder.finish_recording) + return hookrecorder + def get_public_names(l): """Only return names from iterator l without a leading underscore.""" Repository URL: https://bitbucket.org/pytest-dev/pytest/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email. _______________________________________________ pytest-commit mailing list pytest-commit@python.org https://mail.python.org/mailman/listinfo/pytest-commit