Commit 4e0b0b6b authored by Jim Fulton's avatar Jim Fulton

Fix tests for Python 2

For some reason, installation is taking insanely long for Python 2
(10x Py3). NFC, but this bears further investication, given that it's just copying eggs, except pyc re-compilation to get correct path.

- Now wait up to 99 seconds for builds to complete.

- handle build timeout by printing output (rather than a failing
  assertion, now that we know it can happen).

- Got rid of the broken out() function.
parent 0c5b9e80
......@@ -3685,6 +3685,8 @@ def test_suite():
def docSetUp(test):
extra_options = (
" use-dependency-links=false"
# Leaving this here so we can uncomment to see what's going on.
#" log-format=%(asctime)s____%(levelname)s_%(message)s -vvv"
" index=" + os.path.join(ancestor(__file__, 4), 'doc')
)
def run_buildout_in_process(command='buildout'):
......@@ -3694,18 +3696,14 @@ def test_suite():
)
process.daemon = True
process.start()
process.join(9)
assert not process.is_alive()
if process.exitcode:
print(out())
process.join(99)
if process.is_alive() or process.exitcode:
print(read())
def read(path):
def read(path='out'):
with open(path) as f:
return f.read()
def out():
read('out')
def write(text, path):
with open(path, 'w') as f:
f.write(text)
......@@ -3717,7 +3715,6 @@ def test_suite():
eq=lambda a, b: None if a == b else (a, b),
eqs=lambda a, *b: None if set(a) == set(b) else (a, b),
read=read,
out=out,
write=write,
)
setupstack.setUpDirectory(test)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment