-
-
Save href/b72b317db2d679711883 to your computer and use it in GitHub Desktop.
pytest-xdist with Buildout on Python 3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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