diff --git a/CHANGELOG b/CHANGELOG index d1fbaeb6a..9034cbfc3 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -54,6 +54,8 @@ Changes between 2.2.4 and 2.3.0.dev - factory discovery no longer fails with magic global callables that provide no sane __code__ object (mock.call for example) +- fix issue 182: testdir.inprocess_run now considers passed plugins + - reporting refinements: - pytest_report_header now receives a "startdir" so that diff --git a/_pytest/pytester.py b/_pytest/pytester.py index 11f2fecc2..19e223da9 100644 --- a/_pytest/pytester.py +++ b/_pytest/pytester.py @@ -355,7 +355,7 @@ class TmpTestdir: if not plugins: plugins = [] plugins.append(Collect()) - ret = self.pytestmain(list(args), plugins=[Collect()]) + ret = self.pytestmain(list(args), plugins=plugins) reprec = rec[0] reprec.ret = ret assert len(rec) == 1 diff --git a/testing/test_pytester.py b/testing/test_pytester.py index 0501ee200..64600f686 100644 --- a/testing/test_pytester.py +++ b/testing/test_pytester.py @@ -123,3 +123,13 @@ def test_makepyfile_unicode(testdir): except NameError: unichr = chr testdir.makepyfile(unichr(0xfffd)) + +def test_inprocess_plugins(testdir): + class Plugin(object): + configured = False + def pytest_configure(self, config): + self.configured = True + plugin = Plugin() + testdir.inprocess_run([], [plugin]) + + assert plugin.configured