예제 #1
0
    def pytest_runtest_protocol(self, item, nextitem):
        if not self.testsuite:
            module = parent_module(item)

            self.impl.start_suite(name=module.module.__name__,
                                  description=module.module.__doc__ or None)
            self.testsuite = 'Yes'

        name = '.'.join(mangle_testnames([x.name for x in parent_down_from_module(item)]))
        self.impl.start_case(name, description=item.function.__doc__, labels=labels_of(item))
        yield

        if not nextitem or parent_module(item) != parent_module(nextitem):
            self.impl.stop_suite()
            self.testsuite = None
예제 #2
0
    def pytest_runtest_protocol(self, __multicall__, item, nextitem):
        if not self.testsuite:
            module = parent_module(item)
            self.impl.start_suite(name='.'.join(mangle_testnames(module.nodeid.split("::"))),
                                  description=module.module.__doc__ or None)
            self.testsuite = 'Yes'

        name = '.'.join(mangle_testnames([x.name for x in parent_down_from_module(item)]))
        self.impl.start_case(name, description=item.function.__doc__, labels=labels_of(item))
        result = __multicall__.execute()

        if not nextitem or parent_module(item) != parent_module(nextitem):
            self.impl.stop_suite()
            self.testsuite = None

        return result
예제 #3
0
    def pytest_runtest_protocol(self, item, nextitem):
        if not self.testsuite:
            module = parent_module(item)

            self.impl.start_suite(name=module.module.__name__,
                                  description=module.module.__doc__ or None)
            self.testsuite = 'Yes'

        name = '.'.join(
            mangle_testnames([x.name for x in parent_down_from_module(item)]))
        self.impl.start_case(name,
                             description=item.function.__doc__,
                             labels=labels_of(item))
        yield

        if not nextitem or parent_module(item) != parent_module(nextitem):
            self.impl.stop_suite()
            self.testsuite = None
예제 #4
0
 def report_case(self, item, report):
     """
     Adds `self.test` to the `report` in a `AllureAggegatingListener`-understood way
     """
     parent = parent_module(item)
     # we attach a four-tuple: (test module ID, test module name, test module doc, environment, TestCase)
     report.__dict__.update(
         _allure_result=pickle.dumps((parent.nodeid, parent.module.__name__,
                                      parent.module.__doc__ or '',
                                      self.environment, self.test)))
예제 #5
0
    def pytest_runtest_protocol(self, __multicall__, item, nextitem):
        if not self.testsuite:
            module = parent_module(item)

            self.impl.start_suite(name='.'.join(mangle_testnames(module.nodeid.split("::"))),
                                  description=module.module.__doc__ or None)
            self.testsuite = 'Yes'

        name = '.'.join(mangle_testnames([x.name for x in parent_down_from_module(item)]))

        self.impl.start_case(name, description=item.function.__doc__, severity=severity_of(item))

        result = __multicall__.execute()

        if not nextitem or parent_module(item) != parent_module(nextitem):
            self.impl.stop_suite()
            self.testsuite = None

        return result
예제 #6
0
 def report_case(self, item, report):
     """
     Adds `self.test` to the `report` in a `AllureAggegatingListener`-understood way
     """
     parent = parent_module(item)
     # we attach a four-tuple: (test module ID, test module name, test module doc, environment, TestCase)
     report.__dict__.update(
         _allure_result=pickle.dumps(
             (parent.nodeid, parent.module.__name__, parent.module.__doc__ or "", self.environment, self.test)
         )
     )