How to use the py.builtin.print_ function in py

To help you get started, we’ve selected a few py examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github mozillazg / pypy / _pytest / terminal.py View on Github external
def getreportopt(config):
    reportopts = ""
    optvalue = config.option.report
    if optvalue:
        py.builtin.print_("DEPRECATED: use -r instead of --report option.",
            file=sys.stderr)
        if optvalue:
            for setting in optvalue.split(","):
                setting = setting.strip()
                if setting == "skipped":
                    reportopts += "s"
                elif setting == "xfailed":
                    reportopts += "x"
    reportchars = config.option.reportchars
    if reportchars:
        for char in reportchars:
            if char not in reportopts and char != 'a':
                reportopts += char
            elif char == 'a':
                reportopts = 'fEsxXw'
    return reportopts
github mozillazg / pypy / _pytest / pytester.py View on Github external
def _dump_lines(self, lines, fp):
        try:
            for line in lines:
                py.builtin.print_(line, file=fp)
        except UnicodeEncodeError:
            print("couldn't print to %s because of encoding" % (fp,))
github tox-dev / tox / tox / _pytestplugin.py View on Github external
def dump_lines(lines, fp):
            try:
                for line in lines:
                    py.builtin.print_(line, file=fp)
            except UnicodeEncodeError:
                print("couldn't print to %s because of encoding" % (fp,))
        dump_lines(out, sys.stdout)
github pytest-dev / pytest-xdist / xdist / txnode.py View on Github external
self._down = True
                self.slaveoutput = kwargs['slaveoutput']
                error = kwargs['error']
                self.notify("pytest_testnodedown", error=error, node=self)
            elif eventname in ("pytest_runtest_logreport",
                               "pytest__teardown_final_logerror"):
                kwargs['report'].node = self
                self.notify(eventname, **kwargs)
            else:
                self.notify(eventname, **kwargs)
        except KeyboardInterrupt:
            # should not land in receiver-thread
            raise
        except:
            excinfo = py.code.ExceptionInfo()
            py.builtin.print_("!" * 20, excinfo)
            self.config.pluginmanager.notify_exception(excinfo)
github touilleMan / godot-python / tests / _lib_vendors / _pytest / resultlog.py View on Github external
def write_log_entry(self, testpath, lettercode, longrepr):
        py.builtin.print_("%s %s" % (lettercode, testpath), file=self.logfile)
        for line in longrepr.splitlines():
            py.builtin.print_(" %s" % line, file=self.logfile)
github spack / spack / lib / spack / external / _pytest / pytester.py View on Github external
def assert_contains(self, entries):
        __tracebackhide__ = True
        i = 0
        entries = list(entries)
        backlocals = sys._getframe(1).f_locals
        while entries:
            name, check = entries.pop(0)
            for ind, call in enumerate(self.calls[i:]):
                if call._name == name:
                    print_("NAMEMATCH", name, call)
                    if eval(check, backlocals, call.__dict__):
                        print_("CHECKERMATCH", repr(check), "->", call)
                    else:
                        print_("NOCHECKERMATCH", repr(check), "-", call)
                        continue
                    i += ind + 1
                    break
                print_("NONAMEMATCH", name, "with", call)
            else:
                pytest.fail("could not find %r check %r" % (name, check))
github pytest-dev / pytest / testing / root / test_py_imports.py View on Github external
def check_import(modpath):
    py.builtin.print_("checking import", modpath)
    assert __import__(modpath)
github mozillazg / pypy / _pytest / resultlog.py View on Github external
def write_log_entry(self, testpath, lettercode, longrepr):
        py.builtin.print_("%s %s" % (lettercode, testpath), file=self.logfile)
        for line in longrepr.splitlines():
            py.builtin.print_(" %s" % line, file=self.logfile)
github pytest-dev / pytest-xdist / xdist / gwmanage.py View on Github external
def _report_send_file(self, gateway, modified_rel_path):
        if self._verbose:
            path = os.path.basename(self._sourcedir) + "/" + modified_rel_path
            remotepath = gateway.spec.chdir
            py.builtin.print_('%s:%s <= %s' %
                              (gateway.spec, remotepath, path))