Beispiel #1
0
    def run(self): 
        """ invoke a subprocess running the test file via PyPy. 
            record its output into the 'result/user@host' subdirectory. 
            (we might want to create subdirectories for 
            each user, because we will probably all produce 
            such result runs and they will not be the same
            i am afraid. 
        """ 
        regrtest = self.parent.regrtest
        result = self.getresult(regrtest) 
        testresultdir = ensuretestresultdir()
        if testresultdir is not None:
            resultdir = testresultdir.join(result['userhost'])
            assert resultdir.ensure(dir=1)

            fn = resultdir.join(regrtest.basename).new(ext='.txt') 
            if result.istimeout(): 
                if fn.check(file=1): 
                    try: 
                        oldresult = ResultFromMime(fn)
                    except TypeError: 
                        pass
                    else: 
                        if not oldresult.istimeout(): 
                            py.test.skip("timed out, not overwriting "
                                         "more interesting non-timeout outcome")
            
            fn.write(result.repr_mimemessage().as_string(unixfrom=False))
            
        if result['exit-status']:  
             time.sleep(0.5)   # time for a Ctrl-C to reach us :-)
             print >>sys.stdout, result.getnamedtext('stdout') 
             print >>sys.stderr, result.getnamedtext('stderr') 
             py.test.fail("running test failed, see stderr output below") 
 def test_timeout(self):
     test = ResultFromMime(testpath.join('test___all__.txt'))
     assert test.ratio_of_passed() == 0.
 def test_doctest_slash(self):
     test = ResultFromMime(testpath.join('test_descr.txt'))
     assert test.ratio_of_passed() == 65./92
 def test_fail(self):
     test = ResultFromMime(testpath.join('test_global.txt'))
     assert test.ratio_of_passed() == 0.
 def test_unittest_partial(self):
     test = ResultFromMime(testpath.join('test_compile.txt'))
     assert test.ratio_of_passed() == 10./15
 def test_doctest_of(self):
     test = ResultFromMime(testpath.join('test_generators.txt'))
     assert test.ratio_of_passed() == 133./154
Beispiel #7
0
 def test_unittest_partial(self):
     test = ResultFromMime(testpath.join('test_compile.txt'))
     assert test.ratio_of_passed() == 10. / 15
 def test_passed(self):
     test = ResultFromMime(testpath.join('test_sys.txt'))
     assert test.ratio_of_passed() == 1.
Beispiel #9
0
 def test_passed(self):
     test = ResultFromMime(testpath.join('test_sys.txt'))
     assert test.ratio_of_passed() == 1.
Beispiel #10
0
 def test_timeout(self):
     test = ResultFromMime(testpath.join('test___all__.txt'))
     assert test.ratio_of_passed() == 0.
Beispiel #11
0
 def test_fail(self):
     test = ResultFromMime(testpath.join('test_global.txt'))
     assert test.ratio_of_passed() == 0.
Beispiel #12
0
 def test_doctest_slash(self):
     test = ResultFromMime(testpath.join('test_descr.txt'))
     assert test.ratio_of_passed() == 65. / 92
Beispiel #13
0
 def test_doctest_of(self):
     test = ResultFromMime(testpath.join('test_generators.txt'))
     assert test.ratio_of_passed() == 133. / 154