fix issue 182: testdir.inprocess_run now considers passed plugins
This commit is contained in:
parent
848c749d1a
commit
bfaf8e50b6
|
@ -54,6 +54,8 @@ Changes between 2.2.4 and 2.3.0.dev
|
||||||
- factory discovery no longer fails with magic global callables
|
- factory discovery no longer fails with magic global callables
|
||||||
that provide no sane __code__ object (mock.call for example)
|
that provide no sane __code__ object (mock.call for example)
|
||||||
|
|
||||||
|
- fix issue 182: testdir.inprocess_run now considers passed plugins
|
||||||
|
|
||||||
- reporting refinements:
|
- reporting refinements:
|
||||||
|
|
||||||
- pytest_report_header now receives a "startdir" so that
|
- pytest_report_header now receives a "startdir" so that
|
||||||
|
|
|
@ -355,7 +355,7 @@ class TmpTestdir:
|
||||||
if not plugins:
|
if not plugins:
|
||||||
plugins = []
|
plugins = []
|
||||||
plugins.append(Collect())
|
plugins.append(Collect())
|
||||||
ret = self.pytestmain(list(args), plugins=[Collect()])
|
ret = self.pytestmain(list(args), plugins=plugins)
|
||||||
reprec = rec[0]
|
reprec = rec[0]
|
||||||
reprec.ret = ret
|
reprec.ret = ret
|
||||||
assert len(rec) == 1
|
assert len(rec) == 1
|
||||||
|
|
|
@ -123,3 +123,13 @@ def test_makepyfile_unicode(testdir):
|
||||||
except NameError:
|
except NameError:
|
||||||
unichr = chr
|
unichr = chr
|
||||||
testdir.makepyfile(unichr(0xfffd))
|
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
|
||||||
|
|
Loading…
Reference in New Issue