Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xsetup.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/setup.py b/setup.py
index fb500c1..106f799 100755
--- a/setup.py
+++ b/setup.py
@@ -5,6 +5,7 @@ from os.path import splitext, basename, join as pjoin, walk
import os, sys
import glob
from unittest import TestLoader, TextTestRunner, TestSuite
+from subprocess import Popen
COVERAGE_IGNORE=[
"tutorius/apilib",
@@ -47,6 +48,14 @@ class TestCommand(Command):
'site-packages')
sys.path.insert(1, prefix)
os.environ.setdefault('SUGAR_PREFIX', self.prefix)
+
+ # start another X server so test that manipulates the shell can mess it
+ # up as they wish.
+ # :111 should be high enough, unless we already run sugar-emulator 10
+ # times.
+ x_server = Popen(executable='Xephyr', args=['Xephyr', ':111'])
+ os.environ['DISPLAY'] = ':111'
+
if self.coverage:
import coverage
coverage.erase()
@@ -87,6 +96,8 @@ class TestCommand(Command):
os.chdir(curdir)
coverage.erase()
+ x_server.terminate()
+
def _listsources(self, arg, dirname, fnames):
for name in list(fnames):
if os.path.join(dirname, name) in COVERAGE_IGNORE: