Skip to content

Instantly share code, notes, and snippets.

@href
Forked from bubenkoff/gist:5764377
Last active August 29, 2015 14:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save href/b72b317db2d679711883 to your computer and use it in GitHub Desktop.
Save href/b72b317db2d679711883 to your computer and use it in GitHub Desktop.
pytest-xdist with Buildout on Python 3
buildout.cfg:
[py]
recipe = zc.recipe.egg
...
interpreter = py
initialization =
import sys, os
try:
if '-u' in sys.argv:
class Unbuffered(object):
def __init__(self, stream):
self.stream = stream
def write(self, data):
self.stream.write(data)
self.stream.flush()
def __getattr__(self, attr):
return getattr(self.stream, attr)
sys.stdout = Unbuffered(sys.stdout)
sys.argv.remove('-u')
except ValueError:
pass
Run tests:
bin/py.test --tx='2*popen//python=bin/py' --dist=load
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment