Commits

holger krekel committed 90734eb

fix issue34

Comments (0)

Files changed (7)

+1.6 (dev)
+-------------------------
+
+- terser collection reporting
+
+- fix issue34 - distributed testing with -p plugin now works correctly
+
 1.5
 -------------------------
 
 
 setup(
     name="pytest-xdist",
-    version='1.6.dev2',
+    version='1.6.dev3',
     description='py.test xdist plugin for distributed testing and loop-on-failing modes',
     long_description=open('README.txt').read(),
     license='GPLv2 or later',
     packages = ['xdist'],
     entry_points = {'pytest11': ['xdist = xdist.plugin'],},
     zip_safe=False,
-    install_requires = ['execnet>=1.0.8', 'pytest>1.9.9'],
+    install_requires = ['execnet>=1.0.8', 'pytest>2.0.2'],
     classifiers=[
     'Development Status :: 5 - Production/Stable',
     'Intended Audience :: Developers',

testing/acceptance_test.py

         "*1 skipped*"
     ])
 
-
-
+def test_issue34_pluginloading_in_subprocess(testdir):
+    testdir.tmpdir.join("plugin123.py").write(py.code.Source("""
+        def pytest_namespace():
+            return {'sample_variable': 'testing'}
+    """))
+    testdir.makepyfile("""
+        import pytest
+        def test_hello():
+            assert pytest.sample_variable == "testing"
+    """)
+    result = testdir.runpytest("-n1", "-p", "plugin123")
+    assert result.ret == 0
+    result.stdout.fnmatch_lines([
+        "*1 passed*",
+    ])

testing/test_remote.py

     config1 = testdir.parseconfig()
     config2 = remote_initconfig(config1.option.__dict__, config1.args)
     assert config2.option.__dict__ == config1.option.__dict__
-    assert config2.pluginmanager.getplugin("terminal") == None
+    assert config2.pluginmanager.getplugin("terminal") in (-1, None)
 
 class TestReportSerialization:
     def test_itemreport_outcomes(self, testdir):

xdist/__init__.py

 #
-__version__ = '1.6.dev2'
+__version__ = '1.6.dev3'

xdist/looponfail.py

 
     #fullwidth, hasmarkup = channel.receive()
     from _pytest.config import Config
-    config = Config()
-    config.option.__dict__.update(option_dict)
-    config._preparse(list(args))
+    config = Config.fromdictargs(option_dict, list(args))
     config.args = args
     from xdist.looponfail import SlaveFailSession
     SlaveFailSession(config, channel).main()
 
 def remote_initconfig(option_dict, args):
     from _pytest.config import Config
-    config = Config()
-    config.pluginmanager.unregister(name="terminal")
-    config._preparse(args, addopts=False)
-    config.option.__dict__.update(option_dict)
+    option_dict['plugins'].append("no:terminal")
+    config = Config.fromdictargs(option_dict, args)
     config.option.looponfail = False
     config.option.usepdb = False
     config.option.dist = "no"