author David Douard <david.douard@logilab.fr>
Sun, 26 Oct 2014 15:41:11 +0100
changeset 1764 8473295c50b1
parent 1746 4d9ae2462503
permissions -rw-r--r--
[testutils] add a 'local' argument to ApycotBaseTC.hgrepo() set it to False to use repo.source_url instead of repo.local_cache

from apycotlib import atest, writer, ERROR

class apycot_environment(object):
    def __init__(self, plan):
        self.plan = plan

    def __enter__(self):
        w  = writer.TestDataWriter(self.plan.cnxh, self.plan.plandata['eid'])
        test = atest.Test(self.plan.plandata, w)
        self.test = test
        return test

    def __exit__(self, exc_type, exc_val, exc_tb):
        if exc_type is not None:
            self.test.global_status = ERROR