make py lib a self-contained directory again
- move and merge _py/ bits back to py/ - fixes all around --HG-- branch : trunk
This commit is contained in:
parent
4dd6c7679d
commit
b04a04cabd
|
@ -1,5 +0,0 @@
|
|||
|
||||
import py
|
||||
import _py
|
||||
|
||||
impldir = py.path.local(_py.__file__).dirpath()
|
|
@ -127,7 +127,7 @@ class RestWriter:
|
|||
|
||||
class PluginOverview(RestWriter):
|
||||
def makerest(self, config):
|
||||
plugindir = py.path.local(py.__file__).dirpath("test", "plugin")
|
||||
plugindir = py._dir.join('plugin')
|
||||
for cat, specs in plugins:
|
||||
pluginlist = specs.split()
|
||||
self.h1(cat)
|
||||
|
@ -252,7 +252,7 @@ class PluginDoc(RestWriter):
|
|||
warn("missing docstring", func)
|
||||
|
||||
def emit_options(self, plugin):
|
||||
from _py.test.parseopt import Parser
|
||||
from py.impl.test.parseopt import Parser
|
||||
options = []
|
||||
parser = Parser(processopt=options.append)
|
||||
if hasattr(plugin, 'pytest_addoption'):
|
||||
|
|
|
@ -110,3 +110,4 @@ def test_make_sdist_and_run_it(py_setup, venv):
|
|||
ch = gw.remote_exec("import py ; channel.send(py.__version__)")
|
||||
version = ch.receive()
|
||||
assert version == py.__version__
|
||||
ch = gw.remote_exec("import py ; channel.send(py.__version__)")
|
||||
|
|
232
py/__init__.py
232
py/__init__.py
|
@ -18,171 +18,173 @@ For questions please check out http://pylib.org/contact.html
|
|||
version = "trunk"
|
||||
|
||||
__version__ = version = version or "1.1.x"
|
||||
import _py.apipkg
|
||||
import py.apipkg
|
||||
|
||||
_py.apipkg.initpkg(__name__, dict(
|
||||
py.apipkg.initpkg(__name__, dict(
|
||||
# access to all standard lib modules
|
||||
std = '_py.std:std',
|
||||
std = '.impl.std:std',
|
||||
# access to all posix errno's as classes
|
||||
error = '_py.error:error',
|
||||
error = '.impl.error:error',
|
||||
|
||||
_impldir = '_py._metainfo:impldir',
|
||||
_impldir = '.impl._metainfo:impldir',
|
||||
_dir = '.impl._metainfo:pydir',
|
||||
_pydirs = '.impl._metainfo:pydirs',
|
||||
version = 'py:__version__', # backward compatibility
|
||||
|
||||
_com = {
|
||||
'Registry': '_py._com:Registry',
|
||||
'MultiCall': '_py._com:MultiCall',
|
||||
'comregistry': '_py._com:comregistry',
|
||||
'HookRelay': '_py._com:HookRelay',
|
||||
'Registry': '.impl._com:Registry',
|
||||
'MultiCall': '.impl._com:MultiCall',
|
||||
'comregistry': '.impl._com:comregistry',
|
||||
'HookRelay': '.impl._com:HookRelay',
|
||||
},
|
||||
cmdline = {
|
||||
'pytest': '_py.cmdline.pytest:main',
|
||||
'pylookup': '_py.cmdline.pylookup:main',
|
||||
'pycountloc': '_py.cmdline.pycountlog:main',
|
||||
'pytest': '_py.test.cmdline:main',
|
||||
'pylookup': '_py.cmdline.pylookup:main',
|
||||
'pycountloc': '_py.cmdline.pycountloc:main',
|
||||
'pycleanup': '_py.cmdline.pycleanup:main',
|
||||
'pywhich' : '_py.cmdline.pywhich:main',
|
||||
'pysvnwcrevert' : '_py.cmdline.pysvnwcrevert:main',
|
||||
'pyconvert_unittest' : '_py.cmdline.pyconvert_unittest:main',
|
||||
'pytest': '.impl.cmdline.pytest:main',
|
||||
'pylookup': '.impl.cmdline.pylookup:main',
|
||||
'pycountloc': '.impl.cmdline.pycountlog:main',
|
||||
'pytest': '.impl.test.cmdline:main',
|
||||
'pylookup': '.impl.cmdline.pylookup:main',
|
||||
'pycountloc': '.impl.cmdline.pycountloc:main',
|
||||
'pycleanup': '.impl.cmdline.pycleanup:main',
|
||||
'pywhich' : '.impl.cmdline.pywhich:main',
|
||||
'pysvnwcrevert' : '.impl.cmdline.pysvnwcrevert:main',
|
||||
'pyconvert_unittest' : '.impl.cmdline.pyconvert_unittest:main',
|
||||
},
|
||||
|
||||
test = {
|
||||
# helpers for use from test functions or collectors
|
||||
'__doc__' : '_py.test:__doc__',
|
||||
'_PluginManager' : '_py.test.pluginmanager:PluginManager',
|
||||
'raises' : '_py.test.outcome:raises',
|
||||
'skip' : '_py.test.outcome:skip',
|
||||
'importorskip' : '_py.test.outcome:importorskip',
|
||||
'fail' : '_py.test.outcome:fail',
|
||||
'exit' : '_py.test.outcome:exit',
|
||||
'__doc__' : '.impl.test:__doc__',
|
||||
'_PluginManager' : '.impl.test.pluginmanager:PluginManager',
|
||||
'raises' : '.impl.test.outcome:raises',
|
||||
'skip' : '.impl.test.outcome:skip',
|
||||
'importorskip' : '.impl.test.outcome:importorskip',
|
||||
'fail' : '.impl.test.outcome:fail',
|
||||
'exit' : '.impl.test.outcome:exit',
|
||||
# configuration/initialization related test api
|
||||
'config' : '_py.test.config:config_per_process',
|
||||
'ensuretemp' : '_py.test.config:ensuretemp',
|
||||
'config' : '.impl.test.config:config_per_process',
|
||||
'ensuretemp' : '.impl.test.config:ensuretemp',
|
||||
'collect': {
|
||||
'Collector' : '_py.test.collect:Collector',
|
||||
'Directory' : '_py.test.collect:Directory',
|
||||
'File' : '_py.test.collect:File',
|
||||
'Item' : '_py.test.collect:Item',
|
||||
'Module' : '_py.test.pycollect:Module',
|
||||
'Class' : '_py.test.pycollect:Class',
|
||||
'Instance' : '_py.test.pycollect:Instance',
|
||||
'Generator' : '_py.test.pycollect:Generator',
|
||||
'Function' : '_py.test.pycollect:Function',
|
||||
'_fillfuncargs' : '_py.test.funcargs:fillfuncargs',
|
||||
'Collector' : '.impl.test.collect:Collector',
|
||||
'Directory' : '.impl.test.collect:Directory',
|
||||
'File' : '.impl.test.collect:File',
|
||||
'Item' : '.impl.test.collect:Item',
|
||||
'Module' : '.impl.test.pycollect:Module',
|
||||
'Class' : '.impl.test.pycollect:Class',
|
||||
'Instance' : '.impl.test.pycollect:Instance',
|
||||
'Generator' : '.impl.test.pycollect:Generator',
|
||||
'Function' : '.impl.test.pycollect:Function',
|
||||
'_fillfuncargs' : '.impl.test.funcargs:fillfuncargs',
|
||||
},
|
||||
},
|
||||
|
||||
# hook into the top-level standard library
|
||||
process = {
|
||||
'__doc__' : '_py.process:__doc__',
|
||||
'cmdexec' : '_py.process.cmdexec:cmdexec',
|
||||
'kill' : '_py.process.killproc:kill',
|
||||
'ForkedFunc' : '_py.process.forkedfunc:ForkedFunc',
|
||||
'__doc__' : '.impl.process:__doc__',
|
||||
'cmdexec' : '.impl.process.cmdexec:cmdexec',
|
||||
'kill' : '.impl.process.killproc:kill',
|
||||
'ForkedFunc' : '.impl.process.forkedfunc:ForkedFunc',
|
||||
},
|
||||
|
||||
path = {
|
||||
'__doc__' : '_py.path:__doc__',
|
||||
'svnwc' : '_py.path.svnwc:SvnWCCommandPath',
|
||||
'svnurl' : '_py.path.svnurl:SvnCommandPath',
|
||||
'local' : '_py.path.local:LocalPath',
|
||||
'SvnAuth' : '_py.path.svnwc:SvnAuth',
|
||||
'__doc__' : '.impl.path:__doc__',
|
||||
'svnwc' : '.impl.path.svnwc:SvnWCCommandPath',
|
||||
'svnurl' : '.impl.path.svnurl:SvnCommandPath',
|
||||
'local' : '.impl.path.local:LocalPath',
|
||||
'SvnAuth' : '.impl.path.svnwc:SvnAuth',
|
||||
},
|
||||
|
||||
# some nice slightly magic APIs
|
||||
magic = {
|
||||
'invoke' : '_py.code.oldmagic:invoke',
|
||||
'revoke' : '_py.code.oldmagic:revoke',
|
||||
'patch' : '_py.code.oldmagic:patch',
|
||||
'revert' : '_py.code.oldmagic:revert',
|
||||
'autopath' : '_py.path.local:autopath',
|
||||
'AssertionError' : '_py.code.oldmagic2:AssertionError',
|
||||
'invoke' : '.impl.code.oldmagic:invoke',
|
||||
'revoke' : '.impl.code.oldmagic:revoke',
|
||||
'patch' : '.impl.code.oldmagic:patch',
|
||||
'revert' : '.impl.code.oldmagic:revert',
|
||||
'autopath' : '.impl.path.local:autopath',
|
||||
'AssertionError' : '.impl.code.oldmagic2:AssertionError',
|
||||
},
|
||||
|
||||
# python inspection/code-generation API
|
||||
code = {
|
||||
'__doc__' : '_py.code:__doc__',
|
||||
'compile' : '_py.code.source:compile_',
|
||||
'Source' : '_py.code.source:Source',
|
||||
'Code' : '_py.code.code:Code',
|
||||
'Frame' : '_py.code.code:Frame',
|
||||
'ExceptionInfo' : '_py.code.code:ExceptionInfo',
|
||||
'Traceback' : '_py.code.code:Traceback',
|
||||
'getfslineno' : '_py.code.source:getfslineno',
|
||||
'getrawcode' : '_py.code.code:getrawcode',
|
||||
'patch_builtins' : '_py.code.code:patch_builtins',
|
||||
'unpatch_builtins' : '_py.code.code:unpatch_builtins',
|
||||
'_AssertionError' : '_py.code.assertion:AssertionError',
|
||||
'__doc__' : '.impl.code:__doc__',
|
||||
'compile' : '.impl.code.source:compile_',
|
||||
'Source' : '.impl.code.source:Source',
|
||||
'Code' : '.impl.code.code:Code',
|
||||
'Frame' : '.impl.code.code:Frame',
|
||||
'ExceptionInfo' : '.impl.code.code:ExceptionInfo',
|
||||
'Traceback' : '.impl.code.code:Traceback',
|
||||
'getfslineno' : '.impl.code.source:getfslineno',
|
||||
'getrawcode' : '.impl.code.code:getrawcode',
|
||||
'patch_builtins' : '.impl.code.code:patch_builtins',
|
||||
'unpatch_builtins' : '.impl.code.code:unpatch_builtins',
|
||||
'_AssertionError' : '.impl.code.assertion:AssertionError',
|
||||
},
|
||||
|
||||
# backports and additions of builtins
|
||||
builtin = {
|
||||
'__doc__' : '_py.builtin:__doc__',
|
||||
'enumerate' : '_py.builtin:enumerate',
|
||||
'reversed' : '_py.builtin:reversed',
|
||||
'sorted' : '_py.builtin:sorted',
|
||||
'set' : '_py.builtin:set',
|
||||
'frozenset' : '_py.builtin:frozenset',
|
||||
'BaseException' : '_py.builtin:BaseException',
|
||||
'GeneratorExit' : '_py.builtin:GeneratorExit',
|
||||
'print_' : '_py.builtin:print_',
|
||||
'_reraise' : '_py.builtin:_reraise',
|
||||
'_tryimport' : '_py.builtin:_tryimport',
|
||||
'exec_' : '_py.builtin:exec_',
|
||||
'_basestring' : '_py.builtin:_basestring',
|
||||
'_totext' : '_py.builtin:_totext',
|
||||
'_isbytes' : '_py.builtin:_isbytes',
|
||||
'_istext' : '_py.builtin:_istext',
|
||||
'_getimself' : '_py.builtin:_getimself',
|
||||
'_getfuncdict' : '_py.builtin:_getfuncdict',
|
||||
'builtins' : '_py.builtin:builtins',
|
||||
'execfile' : '_py.builtin:execfile',
|
||||
'callable' : '_py.builtin:callable',
|
||||
'__doc__' : '.impl.builtin:__doc__',
|
||||
'enumerate' : '.impl.builtin:enumerate',
|
||||
'reversed' : '.impl.builtin:reversed',
|
||||
'sorted' : '.impl.builtin:sorted',
|
||||
'set' : '.impl.builtin:set',
|
||||
'frozenset' : '.impl.builtin:frozenset',
|
||||
'BaseException' : '.impl.builtin:BaseException',
|
||||
'GeneratorExit' : '.impl.builtin:GeneratorExit',
|
||||
'print_' : '.impl.builtin:print_',
|
||||
'_reraise' : '.impl.builtin:_reraise',
|
||||
'_tryimport' : '.impl.builtin:_tryimport',
|
||||
'exec_' : '.impl.builtin:exec_',
|
||||
'_basestring' : '.impl.builtin:_basestring',
|
||||
'_totext' : '.impl.builtin:_totext',
|
||||
'_isbytes' : '.impl.builtin:_isbytes',
|
||||
'_istext' : '.impl.builtin:_istext',
|
||||
'_getimself' : '.impl.builtin:_getimself',
|
||||
'_getfuncdict' : '.impl.builtin:_getfuncdict',
|
||||
'builtins' : '.impl.builtin:builtins',
|
||||
'execfile' : '.impl.builtin:execfile',
|
||||
'callable' : '.impl.builtin:callable',
|
||||
},
|
||||
|
||||
# input-output helping
|
||||
io = {
|
||||
'__doc__' : '_py.io:__doc__',
|
||||
'dupfile' : '_py.io.capture:dupfile',
|
||||
'TextIO' : '_py.io.capture:TextIO',
|
||||
'BytesIO' : '_py.io.capture:BytesIO',
|
||||
'FDCapture' : '_py.io.capture:FDCapture',
|
||||
'StdCapture' : '_py.io.capture:StdCapture',
|
||||
'StdCaptureFD' : '_py.io.capture:StdCaptureFD',
|
||||
'TerminalWriter' : '_py.io.terminalwriter:TerminalWriter',
|
||||
'__doc__' : '.impl.io:__doc__',
|
||||
'dupfile' : '.impl.io.capture:dupfile',
|
||||
'TextIO' : '.impl.io.capture:TextIO',
|
||||
'BytesIO' : '.impl.io.capture:BytesIO',
|
||||
'FDCapture' : '.impl.io.capture:FDCapture',
|
||||
'StdCapture' : '.impl.io.capture:StdCapture',
|
||||
'StdCaptureFD' : '.impl.io.capture:StdCaptureFD',
|
||||
'TerminalWriter' : '.impl.io.terminalwriter:TerminalWriter',
|
||||
},
|
||||
|
||||
# small and mean xml/html generation
|
||||
xml = {
|
||||
'__doc__' : '_py.xmlgen:__doc__',
|
||||
'html' : '_py.xmlgen:html',
|
||||
'Tag' : '_py.xmlgen:Tag',
|
||||
'raw' : '_py.xmlgen:raw',
|
||||
'Namespace' : '_py.xmlgen:Namespace',
|
||||
'escape' : '_py.xmlgen:escape',
|
||||
'__doc__' : '.impl.xmlgen:__doc__',
|
||||
'html' : '.impl.xmlgen:html',
|
||||
'Tag' : '.impl.xmlgen:Tag',
|
||||
'raw' : '.impl.xmlgen:raw',
|
||||
'Namespace' : '.impl.xmlgen:Namespace',
|
||||
'escape' : '.impl.xmlgen:escape',
|
||||
},
|
||||
|
||||
log = {
|
||||
# logging API ('producers' and 'consumers' connected via keywords)
|
||||
'__doc__' : '_py.log:__doc__',
|
||||
'_apiwarn' : '_py.log.warning:_apiwarn',
|
||||
'Producer' : '_py.log.log:Producer',
|
||||
'setconsumer' : '_py.log.log:setconsumer',
|
||||
'_setstate' : '_py.log.log:setstate',
|
||||
'_getstate' : '_py.log.log:getstate',
|
||||
'Path' : '_py.log.log:Path',
|
||||
'STDOUT' : '_py.log.log:STDOUT',
|
||||
'STDERR' : '_py.log.log:STDERR',
|
||||
'Syslog' : '_py.log.log:Syslog',
|
||||
'__doc__' : '.impl.log:__doc__',
|
||||
'_apiwarn' : '.impl.log.warning:_apiwarn',
|
||||
'Producer' : '.impl.log.log:Producer',
|
||||
'setconsumer' : '.impl.log.log:setconsumer',
|
||||
'_setstate' : '.impl.log.log:setstate',
|
||||
'_getstate' : '.impl.log.log:getstate',
|
||||
'Path' : '.impl.log.log:Path',
|
||||
'STDOUT' : '.impl.log.log:STDOUT',
|
||||
'STDERR' : '.impl.log.log:STDERR',
|
||||
'Syslog' : '.impl.log.log:Syslog',
|
||||
},
|
||||
|
||||
# compatibility modules (deprecated)
|
||||
compat = {
|
||||
'__doc__' : '_py.compat:__doc__',
|
||||
'doctest' : '_py.compat.dep_doctest:doctest',
|
||||
'optparse' : '_py.compat.dep_optparse:optparse',
|
||||
'textwrap' : '_py.compat.dep_textwrap:textwrap',
|
||||
'subprocess' : '_py.compat.dep_subprocess:subprocess',
|
||||
'__doc__' : '.impl.compat:__doc__',
|
||||
'doctest' : '.impl.compat.dep_doctest:doctest',
|
||||
'optparse' : '.impl.compat.dep_optparse:optparse',
|
||||
'textwrap' : '.impl.compat.dep_textwrap:textwrap',
|
||||
'subprocess' : '.impl.compat.dep_subprocess:subprocess',
|
||||
},
|
||||
))
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
|
||||
import py
|
||||
|
||||
pydir = py.path.local(py.__file__).dirpath()
|
||||
impldir = pydir.join("impl")
|
||||
|
||||
# list of all directories beloging to py
|
||||
assert impldir.relto(pydir)
|
||||
pydirs = [pydir]
|
|
@ -9,7 +9,7 @@ prepended."""
|
|||
|
||||
import sys, os
|
||||
import py
|
||||
from _py.io.terminalwriter import ansi_print, terminal_width
|
||||
from py.impl.io.terminalwriter import ansi_print, terminal_width
|
||||
import re
|
||||
|
||||
def rec(p):
|
|
@ -7,7 +7,7 @@ import sys
|
|||
import ast
|
||||
|
||||
import py
|
||||
from _py.code.assertion import _format_explanation, BuiltinAssertionError
|
||||
from py.impl.code.assertion import _format_explanation, BuiltinAssertionError
|
||||
|
||||
|
||||
if sys.platform.startswith("java") and sys.version_info < (2, 5, 2):
|
|
@ -1,7 +1,7 @@
|
|||
import py
|
||||
import sys, inspect
|
||||
from compiler import parse, ast, pycodegen
|
||||
from _py.code.assertion import BuiltinAssertionError, _format_explanation
|
||||
from py.impl.code.assertion import BuiltinAssertionError, _format_explanation
|
||||
|
||||
passthroughex = (KeyboardInterrupt, SystemExit, MemoryError)
|
||||
|
|
@ -38,9 +38,9 @@ def _format_explanation(explanation):
|
|||
|
||||
|
||||
if sys.version_info >= (2, 6) or (sys.platform.startswith("java")):
|
||||
from _py.code._assertionnew import interpret
|
||||
from py.impl.code._assertionnew import interpret
|
||||
else:
|
||||
from _py.code._assertionold import interpret
|
||||
from py.impl.code._assertionold import interpret
|
||||
|
||||
|
||||
class AssertionError(BuiltinAssertionError):
|
|
@ -87,7 +87,7 @@ class Code(object):
|
|||
def fullsource(self):
|
||||
""" return a py.code.Source object for the full source file of the code
|
||||
"""
|
||||
from _py.code import source
|
||||
from py.impl.code import source
|
||||
full, _ = source.findsource(self.raw)
|
||||
return full
|
||||
fullsource = property(fullsource, None, None,
|
||||
|
@ -199,7 +199,7 @@ class TracebackEntry(object):
|
|||
"""Reinterpret the failing statement and returns a detailed information
|
||||
about what operations are performed."""
|
||||
if self.exprinfo is None:
|
||||
from _py.code import assertion
|
||||
from py.impl.code import assertion
|
||||
source = str(self.statement).strip()
|
||||
x = assertion.interpret(source, self.frame, should_fail=True)
|
||||
if not isinstance(x, str):
|
||||
|
@ -741,7 +741,7 @@ oldbuiltins = {}
|
|||
def patch_builtins(assertion=True, compile=True):
|
||||
""" put compile and AssertionError builtins to Python's builtins. """
|
||||
if assertion:
|
||||
from _py.code import assertion
|
||||
from py.impl.code import assertion
|
||||
l = oldbuiltins.setdefault('AssertionError', [])
|
||||
l.append(py.builtin.builtins.AssertionError)
|
||||
py.builtin.builtins.AssertionError = assertion.AssertionError
|
|
@ -1,5 +1,5 @@
|
|||
import py, itertools
|
||||
from _py.path import common
|
||||
from py.impl.path import common
|
||||
|
||||
COUNTER = itertools.count()
|
||||
|
|
@ -3,7 +3,7 @@ local path implementation.
|
|||
"""
|
||||
import sys, os, stat, re, atexit
|
||||
import py
|
||||
from _py.path import common
|
||||
from py.impl.path import common
|
||||
|
||||
iswin32 = sys.platform == "win32"
|
||||
|
|
@ -7,9 +7,9 @@ but might also interact well with earlier versions.
|
|||
import os, sys, time, re
|
||||
import py
|
||||
from py import path, process
|
||||
from _py.path import common
|
||||
from _py.path import svnwc as svncommon
|
||||
from _py.path.cacheutil import BuildcostAccessCache, AgingCache
|
||||
from py.impl.path import common
|
||||
from py.impl.path import svnwc as svncommon
|
||||
from py.impl.path.cacheutil import BuildcostAccessCache, AgingCache
|
||||
|
||||
DEBUG=False
|
||||
|
|
@ -8,7 +8,7 @@ svn-Command based Implementation of a Subversion WorkingCopy Path.
|
|||
import os, sys, time, re, calendar
|
||||
import py
|
||||
import subprocess
|
||||
from _py.path import common
|
||||
from py.impl.path import common
|
||||
|
||||
#-----------------------------------------------------------
|
||||
# Caching latest repository revision and repo-paths
|
|
@ -335,7 +335,7 @@ class Collector(Node):
|
|||
path = self.fspath
|
||||
ntraceback = traceback.cut(path=self.fspath)
|
||||
if ntraceback == traceback:
|
||||
ntraceback = ntraceback.cut(excludepath=py._impldir)
|
||||
ntraceback = ntraceback.cut(excludepath=py._dir)
|
||||
traceback = ntraceback.filter()
|
||||
return traceback
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
import py, os
|
||||
from _py.test.conftesthandle import Conftest
|
||||
from py.impl.test.conftesthandle import Conftest
|
||||
|
||||
from _py.test import parseopt
|
||||
from py.impl.test import parseopt
|
||||
|
||||
def ensuretemp(string, dir=1):
|
||||
""" return temporary directory path with
|
||||
|
@ -221,7 +221,7 @@ class Config(object):
|
|||
""" return an initialized session object. """
|
||||
cls = self._sessionclass
|
||||
if cls is None:
|
||||
from _py.test.session import Session
|
||||
from py.impl.test.session import Session
|
||||
cls = Session
|
||||
session = cls(self)
|
||||
self.trace("instantiated session %r" % session)
|
||||
|
@ -261,8 +261,7 @@ class Config(object):
|
|||
conftestroots = config.getconftest_pathlist("rsyncdirs")
|
||||
if conftestroots:
|
||||
roots.extend(conftestroots)
|
||||
pydirs = [x.realpath() for x in [py.path.local(py.__file__).dirpath(),
|
||||
py._impldir]]
|
||||
pydirs = [x.realpath() for x in py._pydirs]
|
||||
roots = [py.path.local(root) for root in roots]
|
||||
for root in roots:
|
||||
if not root.check():
|
|
@ -5,9 +5,9 @@
|
|||
"""
|
||||
|
||||
import py
|
||||
from _py.test.session import Session
|
||||
from _py.test import outcome
|
||||
from _py.test.dist.nodemanage import NodeManager
|
||||
from py.impl.test.session import Session
|
||||
from py.impl.test import outcome
|
||||
from py.impl.test.dist.nodemanage import NodeManager
|
||||
queue = py.builtin._tryimport('queue', 'Queue')
|
||||
|
||||
debug_file = None # open('/tmp/loop.log', 'w')
|
|
@ -1,7 +1,7 @@
|
|||
import py
|
||||
import sys, os
|
||||
from _py.test.dist.txnode import TXNode
|
||||
from _py.test.dist.gwmanage import GatewayManager
|
||||
from py.impl.test.dist.txnode import TXNode
|
||||
from py.impl.test.dist.gwmanage import GatewayManager
|
||||
|
||||
|
||||
class NodeManager(object):
|
|
@ -2,7 +2,7 @@
|
|||
Manage setup, running and local representation of remote nodes/processes.
|
||||
"""
|
||||
import py
|
||||
from _py.test.dist.mypickle import PickleChannel
|
||||
from py.impl.test.dist.mypickle import PickleChannel
|
||||
|
||||
class TXNode(object):
|
||||
""" Represents a Test Execution environment in the controlling process.
|
||||
|
@ -84,8 +84,8 @@ def install_slave(gateway, config):
|
|||
channel = gateway.remote_exec(source="""
|
||||
import os, sys
|
||||
sys.path.insert(0, os.getcwd())
|
||||
from _py.test.dist.mypickle import PickleChannel
|
||||
from _py.test.dist.txnode import SlaveNode
|
||||
from py.impl.test.dist.mypickle import PickleChannel
|
||||
from py.impl.test.dist.txnode import SlaveNode
|
||||
channel = PickleChannel(channel)
|
||||
slavenode = SlaveNode(channel)
|
||||
slavenode.run()
|
|
@ -10,9 +10,9 @@
|
|||
import py
|
||||
import sys
|
||||
import execnet
|
||||
from _py.test.session import Session
|
||||
from _py.test.dist.mypickle import PickleChannel
|
||||
from _py.test.looponfail import util
|
||||
from py.impl.test.session import Session
|
||||
from py.impl.test.dist.mypickle import PickleChannel
|
||||
from py.impl.test.looponfail import util
|
||||
|
||||
class LooponfailingSession(Session):
|
||||
def __init__(self, config):
|
||||
|
@ -68,8 +68,8 @@ class RemoteControl(object):
|
|||
finally:
|
||||
old.chdir()
|
||||
channel = self.gateway.remote_exec(source="""
|
||||
from _py.test.dist.mypickle import PickleChannel
|
||||
from _py.test.looponfail.remote import slave_runsession
|
||||
from py.impl.test.dist.mypickle import PickleChannel
|
||||
from py.impl.test.looponfail.remote import slave_runsession
|
||||
outchannel = channel.gateway.newchannel()
|
||||
channel.send(outchannel)
|
||||
channel = PickleChannel(channel)
|
|
@ -2,8 +2,8 @@
|
|||
managing loading and interacting with pytest plugins.
|
||||
"""
|
||||
import py
|
||||
from _py.test.plugin import hookspec
|
||||
from _py.test.outcome import Skipped
|
||||
from py.plugin import hookspec
|
||||
from py.impl.test.outcome import Skipped
|
||||
|
||||
def check_old_use(mod, modname):
|
||||
clsname = modname[len('pytest_'):].capitalize() + "Plugin"
|
||||
|
@ -230,7 +230,8 @@ def importplugin(importspec):
|
|||
if str(e).find(importspec) == -1:
|
||||
raise
|
||||
try:
|
||||
return __import__("_py.test.plugin.%s" %(importspec), None, None, '__doc__')
|
||||
return __import__("py.plugin.%s" %(importspec),
|
||||
None, None, '__doc__')
|
||||
except ImportError:
|
||||
e = py.std.sys.exc_info()[1]
|
||||
if str(e).find(importspec) == -1:
|
||||
|
@ -265,8 +266,8 @@ def formatdef(func):
|
|||
)
|
||||
|
||||
if __name__ == "__main__":
|
||||
import _py.test.plugin
|
||||
basedir = py.path.local(_py.test.plugin.__file__).dirpath()
|
||||
import py.plugin
|
||||
basedir = py._dir.join('_plugin')
|
||||
name2text = {}
|
||||
for p in basedir.listdir("pytest_*"):
|
||||
if p.ext == ".py" or (
|
||||
|
@ -276,7 +277,7 @@ if __name__ == "__main__":
|
|||
continue
|
||||
try:
|
||||
plugin = importplugin(impname)
|
||||
except (ImportError, _py.test.outcome.Skipped):
|
||||
except (ImportError, py.impl.test.outcome.Skipped):
|
||||
name2text[impname] = "IMPORT ERROR"
|
||||
else:
|
||||
doc = plugin.__doc__ or ""
|
|
@ -18,8 +18,8 @@ a tree of collectors and test items that this modules provides::
|
|||
"""
|
||||
import py
|
||||
import inspect
|
||||
from _py.test.collect import configproperty, warnoldcollect
|
||||
from _py.test import funcargs
|
||||
from py.impl.test.collect import configproperty, warnoldcollect
|
||||
from py.impl.test import funcargs
|
||||
|
||||
class PyobjMixin(object):
|
||||
def obj():
|
||||
|
@ -257,7 +257,7 @@ class FunctionMixin(PyobjMixin):
|
|||
if ntraceback == traceback:
|
||||
ntraceback = ntraceback.cut(path=path)
|
||||
if ntraceback == traceback:
|
||||
ntraceback = ntraceback.cut(excludepath=py._impldir)
|
||||
ntraceback = ntraceback.cut(excludepath=py._dir)
|
||||
traceback = ntraceback.filter()
|
||||
return traceback
|
||||
|
|
@ -6,7 +6,7 @@
|
|||
"""
|
||||
|
||||
import py
|
||||
from _py.test import outcome
|
||||
from py.impl.test import outcome
|
||||
|
||||
# imports used for genitems()
|
||||
Item = py.test.collect.Item
|
|
@ -110,14 +110,14 @@ def fixoptions(config):
|
|||
def setsession(config):
|
||||
val = config.getvalue
|
||||
if val("collectonly"):
|
||||
from _py.test.session import Session
|
||||
from py.impl.test.session import Session
|
||||
config.setsessionclass(Session)
|
||||
elif execnet:
|
||||
if val("looponfail"):
|
||||
from _py.test.looponfail.remote import LooponfailingSession
|
||||
from py.impl.test.looponfail.remote import LooponfailingSession
|
||||
config.setsessionclass(LooponfailingSession)
|
||||
elif val("dist") != "no":
|
||||
from _py.test.dist.dsession import DSession
|
||||
from py.impl.test.dist.dsession import DSession
|
||||
config.setsessionclass(DSession)
|
||||
|
||||
# pycollect related hooks and code, should move to pytest_pycollect.py
|
|
@ -14,7 +14,7 @@ as well.
|
|||
"""
|
||||
|
||||
import py
|
||||
from _py.code.code import TerminalRepr, ReprFileLocation
|
||||
from py.impl.code.code import TerminalRepr, ReprFileLocation
|
||||
import doctest
|
||||
|
||||
def pytest_addoption(parser):
|
|
@ -3,7 +3,7 @@ interactive debugging with the Python Debugger.
|
|||
"""
|
||||
import py
|
||||
import pdb, sys, linecache
|
||||
from _py.test.outcome import Skipped
|
||||
from py.impl.test.outcome import Skipped
|
||||
try:
|
||||
import execnet
|
||||
except ImportError:
|
|
@ -5,8 +5,8 @@ funcargs and support code for testing py.test's own functionality.
|
|||
import py
|
||||
import sys, os
|
||||
import inspect
|
||||
from _py.test.config import Config as pytestConfig
|
||||
from _py.test.plugin import hookspec
|
||||
from py.impl.test.config import Config as pytestConfig
|
||||
from py.plugin import hookspec
|
||||
from py.builtin import print_
|
||||
|
||||
pytest_plugins = '_pytest'
|
||||
|
@ -301,8 +301,11 @@ class TmpTestdir:
|
|||
return self.run(*fullargs)
|
||||
|
||||
def _getpybinargs(self, scriptname):
|
||||
bindir = py._impldir.dirpath('bin')
|
||||
script = bindir.join(scriptname)
|
||||
bindir = py._dir.dirpath('bin')
|
||||
if not bindir.check():
|
||||
script = py.path.local.sysfind(scriptname)
|
||||
else:
|
||||
script = bindir.join(scriptname)
|
||||
assert script.check()
|
||||
return py.std.sys.executable, script
|
||||
|
|
@ -3,7 +3,7 @@ collect and run test items and create reports.
|
|||
"""
|
||||
|
||||
import py
|
||||
from _py.test.outcome import Skipped
|
||||
from py.impl.test.outcome import Skipped
|
||||
|
||||
#
|
||||
# pytest plugin hooks
|
||||
|
@ -118,7 +118,7 @@ def forked_run_report(item):
|
|||
# for now, we run setup/teardown in the subprocess
|
||||
# XXX optionally allow sharing of setup/teardown
|
||||
EXITSTATUS_TESTEXIT = 4
|
||||
from _py.test.dist.mypickle import ImmutablePickler
|
||||
from py.impl.test.dist.mypickle import ImmutablePickler
|
||||
ipickle = ImmutablePickler(uneven=0)
|
||||
ipickle.selfmemoize(item.config)
|
||||
# XXX workaround the issue that 2.6 cannot pickle
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue