Exemple #1
0
#!/usr/bin/env python2.7
import argparse, sys, os, textwrap
from erp5.util import taskdistribution

# XXX: This import is required, just to populate sys.modules['test_suite'].
# Even if it's not used in this file. Yuck.
import ERP5TypeTestSuite


def _parsingErrorHandler(data, _):
    print >> sys.stderr, 'Error parsing data:', repr(data)


taskdistribution.patchRPCParser(_parsingErrorHandler)


def makeSuite(node_quantity=None,
              test_suite=None,
              revision=None,
              db_list=None,
              zserver_address_list=None,
              zserver_frontend_url_list=None,
              **kwargs):
    # BBB tests (plural form) is only checked for backward compatibility
    for k in sys.modules.keys():
        if k in (
                'tests',
                'test',
        ) or k.startswith('tests.') or k.startswith('test.'):
            del sys.modules[k]
    singular_succeed = True
Exemple #2
0
#!/usr/bin/env python2.7
import argparse, sys
from erp5.util import taskdistribution

# XXX: This import is required, just to populate sys.modules['test_suite'].
# Even if it's not used in this file. Yuck.
import ERP5TypeTestSuite

def _parsingErrorHandler(data, _):
  print >> sys.stderr, 'Error parsing data:', repr(data)
taskdistribution.patchRPCParser(_parsingErrorHandler)

def makeSuite(node_quantity=None, test_suite=None, revision=None,
              db_list=None, **kwargs):
  # BBB tests (plural form) is only checked for backward compatibility
  for k in sys.modules.keys():
    if k in ('tests', 'test',) or k.startswith('tests.') or k.startswith('test.'):
      del sys.modules[k]
  singular_succeed = True
  while True:
    module_name, class_name = ('%s.%s' % (singular_succeed and 'test' or 'tests',
                                          test_suite)).rsplit('.', 1)
    try:
      suite_class = getattr(__import__(module_name, None, None, [class_name]),
                            class_name)
    except (AttributeError, ImportError):
      if not singular_succeed:
        raise
      singular_succeed = False
    else:
      break