Ejemplo n.º 1
0
                test_stdout = "%s\n%s" % (self.fspath.purebasename, test_stdout)     
                if test_stdout != expected: 
                    exit_status = 2  
                    res, out, err = py.io.StdCapture.call(reportdiff, expected, test_stdout)
                    outcome = 'ERROUT' 
                    result.addnamedtext('reportdiff', out)
            else:
                if 'FAIL' in test_stdout or 'ERROR' in test_stderr:
                    outcome = 'FAIL'
        elif timedout: 
            outcome = "T/O"    
        else: 
            outcome = "ERR"
        
        result['exit-status'] = exit_status 
        result['outcome'] = outcome 
        return result


#
# Sanity check  (could be done more nicely too)
#
import os
samefile = getattr(os.path, 'samefile', 
                   lambda x,y : str(x) == str(y))
if samefile(os.getcwd(), str(regrtestdir.dirpath())):
    raise NotImplementedError(
        "Cannot run py.test with this current directory:\n"
        "the app-level sys.path will contain %s before %s)." % (
            regrtestdir.dirpath(), modregrtestdir.dirpath()))
Ejemplo n.º 2
0
            # test in test_zipimport_support.py
            if re.search(r"\bFAIL\b", test_stdout) or re.search("[^:]ERROR", test_stderr):
                outcome = "FAIL"
                exit_status = 2
        elif timedout:
            outcome = "T/O"
        else:
            outcome = "ERR"

        return skipped, exit_status, test_stdout, test_stderr

    def _keywords(self):
        lst = list(py.test.collect.Item._keywords(self))
        regrtest = self.parent.regrtest
        if regrtest.core:
            lst.append("core")
        return lst


#
# Sanity check  (could be done more nicely too)
#
import os

samefile = getattr(os.path, "samefile", lambda x, y: str(x) == str(y))
if samefile(os.getcwd(), str(regrtestdir.dirpath())):
    raise NotImplementedError(
        "Cannot run py.test with this current directory:\n"
        "the app-level sys.path will contain %s before %s)." % (regrtestdir.dirpath(), modregrtestdir.dirpath())
    )