def inline_genitems(self, *args): #config = self.parseconfig(*args) config = self.parseconfigure(*args) rec = self.getreportrecorder(config) session = Session(config) session.perform_collect() return session.items, rec
def inline_genitems(self, *args): # config = self.parseconfig(*args) config = self.parseconfigure(*args) rec = self.getreportrecorder(config) session = Session(config) session.perform_collect() return session.items, rec
def showfuncargs(config): from _pytest.session import Session session = Session(config) session.perform_collect() if session.items: plugins = session.items[0].getplugins() else: plugins = session.getplugins() curdir = py.path.local() tw = py.io.TerminalWriter() verbose = config.getvalue("verbose") for plugin in plugins: available = [] for name, factory in vars(plugin).items(): if name.startswith(FuncargRequest._argprefix): name = name[len(FuncargRequest._argprefix):] if name not in available: available.append([name, factory]) if available: pluginname = plugin.__name__ for name, factory in available: loc = getlocation(factory, curdir) if verbose: funcargspec = "%s -- %s" % ( name, loc, ) else: funcargspec = name tw.line(funcargspec, green=True) doc = factory.__doc__ or "" if doc: for line in doc.split("\n"): tw.line(" " + line.strip()) else: tw.line(" %s: no docstring available" % (loc, ), red=True)
def getpathnode(self, path): config = self.parseconfig(path) session = Session(config) x = session.fspath.bestrelpath(path) return session.perform_collect([x], genitems=False)[0]
def getnode(self, config, arg): session = Session(config) assert "::" not in str(arg) p = py.path.local(arg) x = session.fspath.bestrelpath(p) return session.perform_collect([x], genitems=False)[0]
def getnode(self, config, arg): session = Session(config) assert '::' not in str(arg) p = py.path.local(arg) x = session.fspath.bestrelpath(p) return session.perform_collect([x], genitems=False)[0]