def __init__(self, job_name, template, **kwargs): self.job_name = job_name self.template = template self.no_artifacts = kwargs.get('no_artifacts', True) self.num_builds = int(kwargs.get('num_builds', composite['num_builds'])) self.minimum_build = int( kwargs.get('minimum_build', composite['min_build'])) self.exclude_builds = [ int(xb) for xb in kwargs.get('exclude_builds', []) ] try: self.work_dir = local(kwargs.get('work_dir', composite['work_dir'])) self.work_dir.ensure(dir=True) except KeyError: self.work_dir = local.mkdtemp() print('Writing composite report to {}'.format( self.work_dir.strpath)) self._progress = None self._queue = Queue() num_workers = 4 for __ in xrange(num_workers): worker = Thread(target=_queue_worker, args=(self, )) worker.daemon = True worker.start()
def test_tmproot(self): d = local.mkdtemp() tmproot = local.get_temproot() try: assert d.check(dir=1) assert d.dirpath() == tmproot finally: d.remove(rec=1)
def __init__(self, job_name, template, **kwargs): self.job_name = job_name self.template = template self.no_artifacts = kwargs.get('no_artifacts', True) self.num_builds = int(kwargs.get('num_builds', composite['num_builds'])) self.minimum_build = int(kwargs.get('minimum_build', composite['min_build'])) self.exclude_builds = [int(xb) for xb in kwargs.get('exclude_builds', [])] try: self.work_dir = local(kwargs.get('work_dir', composite['work_dir'])) self.work_dir.ensure(dir=True) except KeyError: self.work_dir = local.mkdtemp() print('Writing composite report to {}'.format(self.work_dir.strpath)) self._progress = None self._queue = Queue() num_workers = 4 for __ in xrange(num_workers): worker = Thread(target=_queue_worker, args=(self,)) worker.daemon = True worker.start()
def test_mkdtemp_rootdir(tmpdir): dtmp = local.mkdtemp(rootdir=tmpdir) assert tmpdir.listdir() == [dtmp]
def test_mkdtemp_creation(self): d = local.mkdtemp() try: assert d.check(dir=1) finally: d.remove(rec=1)