fix issue 182: testdir.inprocess_run now considers passed plugins

This commit is contained in:
Ronny Pfannschmidt 2012-09-03 10:12:30 +02:00
parent 848c749d1a
commit bfaf8e50b6
3 changed files with 13 additions and 1 deletions

View File

@ -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

View File

@ -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

View File

@ -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