Exemplo n.º 1
0
def _build_assert_functions():
    test_case = TestCase()
    for assert_func_name in dir(test_case):
        if (not assert_func_name.startswith("assert")
                or assert_func_name.endswith("_")):
            continue

        globals()[assert_func_name] = (
            test_case.__getattribute__(assert_func_name))
    def _steams_write_doc(self, result: str, test: TestCase):
        if result == "Pass":
            steams = self.stdout_steams
        else:
            steams = self.stderr_steams

        steams.write(f'{result}\t')
        steams.write(str(test))
        doc = "_testMethodDoc" in test.__dir__() and test.__getattribute__("_testMethodDoc") or ""
        if doc:
            steams.write("\t")
            steams.write(doc.strip().split("\n")[0])
        steams.write('\n')
Exemplo n.º 3
0
 def __getattribute__(self, attr_name):
     "Ensure that all attributes are implemented."
     attr = TestCase.__getattribute__(self, attr_name)
     if attr is NotImplemented:
         raise NotImplementedError(define_in_child(attr_name))
     return attr
Exemplo n.º 4
0
 def __getattribute__(self, attr_name):
     "Ensure that all attributes are implemented."
     attr = TestCase.__getattribute__(self, attr_name)
     if attr is NotImplemented:
         raise NotImplementedError(define_in_child(attr_name))
     return attr
Exemplo n.º 5
0
 def __getattribute__(self, attr_name):
     "Ensure that all attributes are implemented."
     attr =  TestCase.__getattribute__(self, attr_name)
     if attr is NotImplemented:
         raise NotImplementedError(self.nie_fmt % attr_name)
     return attr