Exemple #1
0
    def resultlog(self,
                  name="pkg1",
                  version=None,
                  md5=None,
                  passed=1,
                  failed=1,
                  skipped=1):
        from devpi.test.inject.pytest_devpi import (ReprResultLog,
                                                    getplatforminfo)
        if version is None:
            self._version += 1
            version = "%s" % self._version

        res = ReprResultLog("/%s-%s.tgz" % (name, version), md5 or self.md5(),
                            **getplatforminfo())
        out = py.io.TextIO()
        for i in range(passed):
            out.write(". test_pass.py::test_pass%s\n" % i)
        for i in range(failed):
            out.write("F test_fail.py::test_fail%s\n longrepr%s\n" % (i, i))
        for i in range(skipped):
            out.write("s test_skip.py::test_skip%s\n skiprepr%s\n" % (i, i))
        out.seek(0)
        res.parse_resultfile(out)
        res.version = version
        return res
Exemple #2
0
def test_gen_dump_read(file0, tmpdir, gen):
    packageurl = "http://somewhere.com/package.tgz"
    packagemd5 = gen.md5()
    res = plugin.ReprResultLog(packageurl, packagemd5,
                               **plugin.getplatforminfo())
    res.parse_resultfile(file0)
    assert res.packageurl == packageurl
    assert res.packagemd5 == packagemd5
    assert res.pyversion == py.std.sys.version.replace("\n", "--")
    assert res.platformstring == py.std.platform.platform()
    assert res.platform == py.std.sys.platform
    data = res.dump()
    res2 = plugin.ReprResultLog.new_fromfile(py.io.TextIO(data))
    assert res2 == res
Exemple #3
0
    def resultlog(self, name="pkg1", version=None, md5=None, passed=1, failed=1, skipped=1):
        from devpi.test.inject.pytest_devpi import ReprResultLog, getplatforminfo

        if version is None:
            self._version += 1
            version = "%s" % self._version

        res = ReprResultLog("/%s-%s.tgz" % (name, version), md5 or self.md5(), **getplatforminfo())
        out = py.io.TextIO()
        for i in range(passed):
            out.write(". test_pass.py::test_pass%s\n" % i)
        for i in range(failed):
            out.write("F test_fail.py::test_fail%s\n longrepr%s\n" % (i, i))
        for i in range(skipped):
            out.write("s test_skip.py::test_skip%s\n skiprepr%s\n" % (i, i))
        out.seek(0)
        res.parse_resultfile(out)
        res.version = version
        return res