Commit 7a325c69 authored by Julien Muchembled's avatar Julien Muchembled

fixup! buildout: add profile to test with Python 3

parent 8a1f4101
...@@ -40,17 +40,17 @@ class DummyTestResult: ...@@ -40,17 +40,17 @@ class DummyTestResult:
class BuildoutTestSuite(TestSuite): class BuildoutTestSuite(TestSuite):
RUN_RE = re.compile( RUN_RE = re.compile(
r'Ran (?P<all_tests>\d+) tests with' br'Ran (?P<all_tests>\d+) tests with'
' (?P<failures>\d+) failures,' br' (?P<failures>\d+) failures,'
' (?P<errors>\d+) errors and' br' (?P<errors>\d+) errors and'
' (?P<skips>\d+) skipped in') br' (?P<skips>\d+) skipped in')
def run(self, test): def run(self, test):
start = time() start = time()
try: try:
status_dict = self.spawn(os.path.join('bin', 'zope-testrunner'), status_dict = self.spawn(os.path.join('bin', 'zope-testrunner'),
'--test-path', os.path.join(test_dict[test], 'src')) '--test-path', os.path.join(test_dict[test], 'src'))
except SubprocessError, e: except SubprocessError as e:
status_dict = e.status_dict status_dict = e.status_dict
end = time() end = time()
status_dict.update( status_dict.update(
...@@ -93,7 +93,7 @@ def main(): ...@@ -93,7 +93,7 @@ def main():
else: else:
test_result = DummyTestResult(list(test_dict)) test_result = DummyTestResult(list(test_dict))
fd = os.open('buildout.cfg', os.O_CREAT | os.O_EXCL | os.O_WRONLY, 0666) fd = os.open('buildout.cfg', os.O_CREAT | os.O_EXCL | os.O_WRONLY, 0o666)
try: try:
os.write(fd, str2bytes("""\ os.write(fd, str2bytes("""\
[buildout] [buildout]
...@@ -116,7 +116,7 @@ eggs += ...@@ -116,7 +116,7 @@ eggs +=
scripts = scripts =
zope-testrunner zope-testrunner
""" % (os.path.join(slapos_buildout, 'buildout.cfg'), """ % (os.path.join(slapos_buildout, 'buildout.cfg'),
''.join('\n ' + x for x in test_dict.itervalues()), ''.join('\n ' + x for x in test_dict.values()),
'\n'.join(x + ' =' for x in test_dict)))) '\n'.join(x + ' =' for x in test_dict))))
finally: finally:
os.close(fd) os.close(fd)
......
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