diff --git a/_py/_metainfo.py b/_py/_metainfo.py deleted file mode 100644 index af91973b9..000000000 --- a/_py/_metainfo.py +++ /dev/null @@ -1,5 +0,0 @@ - -import py -import _py - -impldir = py.path.local(_py.__file__).dirpath() diff --git a/bin-for-dist/makepluginlist.py b/bin-for-dist/makepluginlist.py index 0920a0641..73a1cba6e 100644 --- a/bin-for-dist/makepluginlist.py +++ b/bin-for-dist/makepluginlist.py @@ -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'): diff --git a/bin-for-dist/test_install.py b/bin-for-dist/test_install.py index d30c90079..52d30c379 100644 --- a/bin-for-dist/test_install.py +++ b/bin-for-dist/test_install.py @@ -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__)") diff --git a/py/__init__.py b/py/__init__.py index 9023a0f5a..bed2f5ce3 100644 --- a/py/__init__.py +++ b/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', }, )) diff --git a/_py/apipkg.py b/py/apipkg.py similarity index 100% rename from _py/apipkg.py rename to py/apipkg.py diff --git a/_py/__init__.py b/py/impl/__init__.py similarity index 100% rename from _py/__init__.py rename to py/impl/__init__.py diff --git a/_py/_com.py b/py/impl/_com.py similarity index 100% rename from _py/_com.py rename to py/impl/_com.py diff --git a/py/impl/_metainfo.py b/py/impl/_metainfo.py new file mode 100644 index 000000000..fa720bf1d --- /dev/null +++ b/py/impl/_metainfo.py @@ -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] diff --git a/_py/builtin.py b/py/impl/builtin.py similarity index 100% rename from _py/builtin.py rename to py/impl/builtin.py diff --git a/_py/cmdline/__init__.py b/py/impl/cmdline/__init__.py similarity index 100% rename from _py/cmdline/__init__.py rename to py/impl/cmdline/__init__.py diff --git a/_py/cmdline/pycleanup.py b/py/impl/cmdline/pycleanup.py similarity index 100% rename from _py/cmdline/pycleanup.py rename to py/impl/cmdline/pycleanup.py diff --git a/_py/cmdline/pyconvert_unittest.py b/py/impl/cmdline/pyconvert_unittest.py similarity index 100% rename from _py/cmdline/pyconvert_unittest.py rename to py/impl/cmdline/pyconvert_unittest.py diff --git a/_py/cmdline/pycountloc.py b/py/impl/cmdline/pycountloc.py similarity index 100% rename from _py/cmdline/pycountloc.py rename to py/impl/cmdline/pycountloc.py diff --git a/_py/cmdline/pylookup.py b/py/impl/cmdline/pylookup.py similarity index 97% rename from _py/cmdline/pylookup.py rename to py/impl/cmdline/pylookup.py index e087609ba..f0173f951 100755 --- a/_py/cmdline/pylookup.py +++ b/py/impl/cmdline/pylookup.py @@ -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): diff --git a/_py/cmdline/pysvnwcrevert.py b/py/impl/cmdline/pysvnwcrevert.py similarity index 100% rename from _py/cmdline/pysvnwcrevert.py rename to py/impl/cmdline/pysvnwcrevert.py diff --git a/_py/cmdline/pytest.py b/py/impl/cmdline/pytest.py similarity index 100% rename from _py/cmdline/pytest.py rename to py/impl/cmdline/pytest.py diff --git a/_py/cmdline/pywhich.py b/py/impl/cmdline/pywhich.py similarity index 100% rename from _py/cmdline/pywhich.py rename to py/impl/cmdline/pywhich.py diff --git a/_py/code/__init__.py b/py/impl/code/__init__.py similarity index 100% rename from _py/code/__init__.py rename to py/impl/code/__init__.py diff --git a/_py/code/_assertionnew.py b/py/impl/code/_assertionnew.py similarity index 99% rename from _py/code/_assertionnew.py rename to py/impl/code/_assertionnew.py index 6192c714d..c847ddc59 100644 --- a/_py/code/_assertionnew.py +++ b/py/impl/code/_assertionnew.py @@ -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): diff --git a/_py/code/_assertionold.py b/py/impl/code/_assertionold.py similarity index 99% rename from _py/code/_assertionold.py rename to py/impl/code/_assertionold.py index 448fdef3e..2602d508c 100644 --- a/_py/code/_assertionold.py +++ b/py/impl/code/_assertionold.py @@ -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) diff --git a/_py/code/assertion.py b/py/impl/code/assertion.py similarity index 95% rename from _py/code/assertion.py rename to py/impl/code/assertion.py index 32a150d91..b5aea3424 100644 --- a/_py/code/assertion.py +++ b/py/impl/code/assertion.py @@ -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): diff --git a/_py/code/code.py b/py/impl/code/code.py similarity index 99% rename from _py/code/code.py rename to py/impl/code/code.py index f6336be8a..0138c6593 100644 --- a/_py/code/code.py +++ b/py/impl/code/code.py @@ -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 diff --git a/_py/code/oldmagic.py b/py/impl/code/oldmagic.py similarity index 100% rename from _py/code/oldmagic.py rename to py/impl/code/oldmagic.py diff --git a/_py/code/oldmagic2.py b/py/impl/code/oldmagic2.py similarity index 100% rename from _py/code/oldmagic2.py rename to py/impl/code/oldmagic2.py diff --git a/_py/code/source.py b/py/impl/code/source.py similarity index 100% rename from _py/code/source.py rename to py/impl/code/source.py diff --git a/_py/compat/__init__.py b/py/impl/compat/__init__.py similarity index 100% rename from _py/compat/__init__.py rename to py/impl/compat/__init__.py diff --git a/_py/compat/dep_doctest.py b/py/impl/compat/dep_doctest.py similarity index 100% rename from _py/compat/dep_doctest.py rename to py/impl/compat/dep_doctest.py diff --git a/_py/compat/dep_optparse.py b/py/impl/compat/dep_optparse.py similarity index 100% rename from _py/compat/dep_optparse.py rename to py/impl/compat/dep_optparse.py diff --git a/_py/compat/dep_subprocess.py b/py/impl/compat/dep_subprocess.py similarity index 100% rename from _py/compat/dep_subprocess.py rename to py/impl/compat/dep_subprocess.py diff --git a/_py/compat/dep_textwrap.py b/py/impl/compat/dep_textwrap.py similarity index 100% rename from _py/compat/dep_textwrap.py rename to py/impl/compat/dep_textwrap.py diff --git a/_py/error.py b/py/impl/error.py similarity index 100% rename from _py/error.py rename to py/impl/error.py diff --git a/_py/io/__init__.py b/py/impl/io/__init__.py similarity index 100% rename from _py/io/__init__.py rename to py/impl/io/__init__.py diff --git a/_py/io/capture.py b/py/impl/io/capture.py similarity index 100% rename from _py/io/capture.py rename to py/impl/io/capture.py diff --git a/_py/io/terminalwriter.py b/py/impl/io/terminalwriter.py similarity index 100% rename from _py/io/terminalwriter.py rename to py/impl/io/terminalwriter.py diff --git a/_py/log/__init__.py b/py/impl/log/__init__.py similarity index 100% rename from _py/log/__init__.py rename to py/impl/log/__init__.py diff --git a/_py/log/log.py b/py/impl/log/log.py similarity index 100% rename from _py/log/log.py rename to py/impl/log/log.py diff --git a/_py/log/warning.py b/py/impl/log/warning.py similarity index 100% rename from _py/log/warning.py rename to py/impl/log/warning.py diff --git a/_py/path/__init__.py b/py/impl/path/__init__.py similarity index 100% rename from _py/path/__init__.py rename to py/impl/path/__init__.py diff --git a/_py/path/cacheutil.py b/py/impl/path/cacheutil.py similarity index 100% rename from _py/path/cacheutil.py rename to py/impl/path/cacheutil.py diff --git a/_py/path/common.py b/py/impl/path/common.py similarity index 100% rename from _py/path/common.py rename to py/impl/path/common.py diff --git a/_py/path/gateway/__init__.py b/py/impl/path/gateway/__init__.py similarity index 100% rename from _py/path/gateway/__init__.py rename to py/impl/path/gateway/__init__.py diff --git a/_py/path/gateway/channeltest.py b/py/impl/path/gateway/channeltest.py similarity index 100% rename from _py/path/gateway/channeltest.py rename to py/impl/path/gateway/channeltest.py diff --git a/_py/path/gateway/channeltest2.py b/py/impl/path/gateway/channeltest2.py similarity index 100% rename from _py/path/gateway/channeltest2.py rename to py/impl/path/gateway/channeltest2.py diff --git a/_py/path/gateway/remotepath.py b/py/impl/path/gateway/remotepath.py similarity index 97% rename from _py/path/gateway/remotepath.py rename to py/impl/path/gateway/remotepath.py index 17cc1857e..9b4287576 100644 --- a/_py/path/gateway/remotepath.py +++ b/py/impl/path/gateway/remotepath.py @@ -1,5 +1,5 @@ import py, itertools -from _py.path import common +from py.impl.path import common COUNTER = itertools.count() diff --git a/_py/path/local.py b/py/impl/path/local.py similarity index 99% rename from _py/path/local.py rename to py/impl/path/local.py index ad8b18323..cfdff6de7 100644 --- a/_py/path/local.py +++ b/py/impl/path/local.py @@ -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" diff --git a/_py/path/svnurl.py b/py/impl/path/svnurl.py similarity index 98% rename from _py/path/svnurl.py rename to py/impl/path/svnurl.py index 353b6389c..4ef3b655a 100644 --- a/_py/path/svnurl.py +++ b/py/impl/path/svnurl.py @@ -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 diff --git a/_py/path/svnwc.py b/py/impl/path/svnwc.py similarity index 99% rename from _py/path/svnwc.py rename to py/impl/path/svnwc.py index 5575ee06c..380c6d269 100644 --- a/_py/path/svnwc.py +++ b/py/impl/path/svnwc.py @@ -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 diff --git a/_py/process/__init__.py b/py/impl/process/__init__.py similarity index 100% rename from _py/process/__init__.py rename to py/impl/process/__init__.py diff --git a/_py/process/cmdexec.py b/py/impl/process/cmdexec.py similarity index 100% rename from _py/process/cmdexec.py rename to py/impl/process/cmdexec.py diff --git a/_py/process/forkedfunc.py b/py/impl/process/forkedfunc.py similarity index 100% rename from _py/process/forkedfunc.py rename to py/impl/process/forkedfunc.py diff --git a/_py/process/killproc.py b/py/impl/process/killproc.py similarity index 100% rename from _py/process/killproc.py rename to py/impl/process/killproc.py diff --git a/_py/std.py b/py/impl/std.py similarity index 100% rename from _py/std.py rename to py/impl/std.py diff --git a/_py/test/__init__.py b/py/impl/test/__init__.py similarity index 100% rename from _py/test/__init__.py rename to py/impl/test/__init__.py diff --git a/_py/test/cmdline.py b/py/impl/test/cmdline.py similarity index 100% rename from _py/test/cmdline.py rename to py/impl/test/cmdline.py diff --git a/_py/test/collect.py b/py/impl/test/collect.py similarity index 99% rename from _py/test/collect.py rename to py/impl/test/collect.py index 411a9719b..7f2940a10 100644 --- a/_py/test/collect.py +++ b/py/impl/test/collect.py @@ -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 diff --git a/_py/test/compat.py b/py/impl/test/compat.py similarity index 100% rename from _py/test/compat.py rename to py/impl/test/compat.py diff --git a/_py/test/config.py b/py/impl/test/config.py similarity index 97% rename from _py/test/config.py rename to py/impl/test/config.py index cad7b15c8..b3b49ea29 100644 --- a/_py/test/config.py +++ b/py/impl/test/config.py @@ -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(): diff --git a/_py/test/conftesthandle.py b/py/impl/test/conftesthandle.py similarity index 100% rename from _py/test/conftesthandle.py rename to py/impl/test/conftesthandle.py diff --git a/_py/test/defaultconftest.py b/py/impl/test/defaultconftest.py similarity index 100% rename from _py/test/defaultconftest.py rename to py/impl/test/defaultconftest.py diff --git a/_py/test/dist/__init__.py b/py/impl/test/dist/__init__.py similarity index 100% rename from _py/test/dist/__init__.py rename to py/impl/test/dist/__init__.py diff --git a/_py/test/dist/dsession.py b/py/impl/test/dist/dsession.py similarity index 98% rename from _py/test/dist/dsession.py rename to py/impl/test/dist/dsession.py index b2350509d..09ce92669 100644 --- a/_py/test/dist/dsession.py +++ b/py/impl/test/dist/dsession.py @@ -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') diff --git a/_py/test/dist/gwmanage.py b/py/impl/test/dist/gwmanage.py similarity index 100% rename from _py/test/dist/gwmanage.py rename to py/impl/test/dist/gwmanage.py diff --git a/_py/test/dist/mypickle.py b/py/impl/test/dist/mypickle.py similarity index 100% rename from _py/test/dist/mypickle.py rename to py/impl/test/dist/mypickle.py diff --git a/_py/test/dist/nodemanage.py b/py/impl/test/dist/nodemanage.py similarity index 96% rename from _py/test/dist/nodemanage.py rename to py/impl/test/dist/nodemanage.py index ed7b8b0a2..c498cbef8 100644 --- a/_py/test/dist/nodemanage.py +++ b/py/impl/test/dist/nodemanage.py @@ -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): diff --git a/_py/test/dist/txnode.py b/py/impl/test/dist/txnode.py similarity index 97% rename from _py/test/dist/txnode.py rename to py/impl/test/dist/txnode.py index 8406afef0..7c19b08b1 100644 --- a/_py/test/dist/txnode.py +++ b/py/impl/test/dist/txnode.py @@ -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() diff --git a/_py/test/funcargs.py b/py/impl/test/funcargs.py similarity index 100% rename from _py/test/funcargs.py rename to py/impl/test/funcargs.py diff --git a/_py/test/looponfail/__init__.py b/py/impl/test/looponfail/__init__.py similarity index 100% rename from _py/test/looponfail/__init__.py rename to py/impl/test/looponfail/__init__.py diff --git a/_py/test/looponfail/remote.py b/py/impl/test/looponfail/remote.py similarity index 95% rename from _py/test/looponfail/remote.py rename to py/impl/test/looponfail/remote.py index bc281f94d..712475b78 100644 --- a/_py/test/looponfail/remote.py +++ b/py/impl/test/looponfail/remote.py @@ -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) diff --git a/_py/test/looponfail/util.py b/py/impl/test/looponfail/util.py similarity index 100% rename from _py/test/looponfail/util.py rename to py/impl/test/looponfail/util.py diff --git a/_py/test/outcome.py b/py/impl/test/outcome.py similarity index 100% rename from _py/test/outcome.py rename to py/impl/test/outcome.py diff --git a/_py/test/parseopt.py b/py/impl/test/parseopt.py similarity index 100% rename from _py/test/parseopt.py rename to py/impl/test/parseopt.py diff --git a/_py/test/pluginmanager.py b/py/impl/test/pluginmanager.py similarity index 96% rename from _py/test/pluginmanager.py rename to py/impl/test/pluginmanager.py index d322e506c..75e3fb344 100644 --- a/_py/test/pluginmanager.py +++ b/py/impl/test/pluginmanager.py @@ -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 "" diff --git a/_py/test/pycollect.py b/py/impl/test/pycollect.py similarity index 99% rename from _py/test/pycollect.py rename to py/impl/test/pycollect.py index bb0cbed7a..b9d5292cd 100644 --- a/_py/test/pycollect.py +++ b/py/impl/test/pycollect.py @@ -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 diff --git a/_py/test/session.py b/py/impl/test/session.py similarity index 99% rename from _py/test/session.py rename to py/impl/test/session.py index 122095c49..a16c0bd62 100644 --- a/_py/test/session.py +++ b/py/impl/test/session.py @@ -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 diff --git a/_py/xmlgen.py b/py/impl/xmlgen.py similarity index 100% rename from _py/xmlgen.py rename to py/impl/xmlgen.py diff --git a/_py/test/plugin/__init__.py b/py/plugin/__init__.py similarity index 100% rename from _py/test/plugin/__init__.py rename to py/plugin/__init__.py diff --git a/_py/test/plugin/hookspec.py b/py/plugin/hookspec.py similarity index 100% rename from _py/test/plugin/hookspec.py rename to py/plugin/hookspec.py diff --git a/_py/test/plugin/pytest__pytest.py b/py/plugin/pytest__pytest.py similarity index 100% rename from _py/test/plugin/pytest__pytest.py rename to py/plugin/pytest__pytest.py diff --git a/_py/test/plugin/pytest_assertion.py b/py/plugin/pytest_assertion.py similarity index 100% rename from _py/test/plugin/pytest_assertion.py rename to py/plugin/pytest_assertion.py diff --git a/_py/test/plugin/pytest_capture.py b/py/plugin/pytest_capture.py similarity index 100% rename from _py/test/plugin/pytest_capture.py rename to py/plugin/pytest_capture.py diff --git a/_py/test/plugin/pytest_default.py b/py/plugin/pytest_default.py similarity index 96% rename from _py/test/plugin/pytest_default.py rename to py/plugin/pytest_default.py index 6354505a6..bc23f7270 100644 --- a/_py/test/plugin/pytest_default.py +++ b/py/plugin/pytest_default.py @@ -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 diff --git a/_py/test/plugin/pytest_doctest.py b/py/plugin/pytest_doctest.py similarity index 98% rename from _py/test/plugin/pytest_doctest.py rename to py/plugin/pytest_doctest.py index 65ab09c17..5d23a0b11 100644 --- a/_py/test/plugin/pytest_doctest.py +++ b/py/plugin/pytest_doctest.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): diff --git a/_py/test/plugin/pytest_figleaf.py b/py/plugin/pytest_figleaf.py similarity index 100% rename from _py/test/plugin/pytest_figleaf.py rename to py/plugin/pytest_figleaf.py diff --git a/_py/test/plugin/pytest_helpconfig.py b/py/plugin/pytest_helpconfig.py similarity index 100% rename from _py/test/plugin/pytest_helpconfig.py rename to py/plugin/pytest_helpconfig.py diff --git a/_py/test/plugin/pytest_hooklog.py b/py/plugin/pytest_hooklog.py similarity index 100% rename from _py/test/plugin/pytest_hooklog.py rename to py/plugin/pytest_hooklog.py diff --git a/_py/test/plugin/pytest_mark.py b/py/plugin/pytest_mark.py similarity index 100% rename from _py/test/plugin/pytest_mark.py rename to py/plugin/pytest_mark.py diff --git a/_py/test/plugin/pytest_monkeypatch.py b/py/plugin/pytest_monkeypatch.py similarity index 100% rename from _py/test/plugin/pytest_monkeypatch.py rename to py/plugin/pytest_monkeypatch.py diff --git a/_py/test/plugin/pytest_nose.py b/py/plugin/pytest_nose.py similarity index 100% rename from _py/test/plugin/pytest_nose.py rename to py/plugin/pytest_nose.py diff --git a/_py/test/plugin/pytest_pastebin.py b/py/plugin/pytest_pastebin.py similarity index 100% rename from _py/test/plugin/pytest_pastebin.py rename to py/plugin/pytest_pastebin.py diff --git a/_py/test/plugin/pytest_pdb.py b/py/plugin/pytest_pdb.py similarity index 98% rename from _py/test/plugin/pytest_pdb.py rename to py/plugin/pytest_pdb.py index 7e6eccb42..058016751 100644 --- a/_py/test/plugin/pytest_pdb.py +++ b/py/plugin/pytest_pdb.py @@ -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: diff --git a/_py/test/plugin/pytest_pylint.py b/py/plugin/pytest_pylint.py similarity index 100% rename from _py/test/plugin/pytest_pylint.py rename to py/plugin/pytest_pylint.py diff --git a/_py/test/plugin/pytest_pytester.py b/py/plugin/pytest_pytester.py similarity index 98% rename from _py/test/plugin/pytest_pytester.py rename to py/plugin/pytest_pytester.py index 15ceafa93..10fc3ac10 100644 --- a/_py/test/plugin/pytest_pytester.py +++ b/py/plugin/pytest_pytester.py @@ -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 diff --git a/_py/test/plugin/pytest_recwarn.py b/py/plugin/pytest_recwarn.py similarity index 100% rename from _py/test/plugin/pytest_recwarn.py rename to py/plugin/pytest_recwarn.py diff --git a/_py/test/plugin/pytest_restdoc.py b/py/plugin/pytest_restdoc.py similarity index 100% rename from _py/test/plugin/pytest_restdoc.py rename to py/plugin/pytest_restdoc.py diff --git a/_py/test/plugin/pytest_resultlog.py b/py/plugin/pytest_resultlog.py similarity index 100% rename from _py/test/plugin/pytest_resultlog.py rename to py/plugin/pytest_resultlog.py diff --git a/_py/test/plugin/pytest_runner.py b/py/plugin/pytest_runner.py similarity index 98% rename from _py/test/plugin/pytest_runner.py rename to py/plugin/pytest_runner.py index 8a1569a93..7e6fe9827 100644 --- a/_py/test/plugin/pytest_runner.py +++ b/py/plugin/pytest_runner.py @@ -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 diff --git a/_py/test/plugin/pytest_skipping.py b/py/plugin/pytest_skipping.py similarity index 100% rename from _py/test/plugin/pytest_skipping.py rename to py/plugin/pytest_skipping.py diff --git a/_py/test/plugin/pytest_terminal.py b/py/plugin/pytest_terminal.py similarity index 100% rename from _py/test/plugin/pytest_terminal.py rename to py/plugin/pytest_terminal.py diff --git a/_py/test/plugin/pytest_tmpdir.py b/py/plugin/pytest_tmpdir.py similarity index 100% rename from _py/test/plugin/pytest_tmpdir.py rename to py/plugin/pytest_tmpdir.py diff --git a/_py/test/plugin/pytest_unittest.py b/py/plugin/pytest_unittest.py similarity index 100% rename from _py/test/plugin/pytest_unittest.py rename to py/plugin/pytest_unittest.py diff --git a/setup.py b/setup.py index 8961bfafa..0793da9a5 100644 --- a/setup.py +++ b/setup.py @@ -54,18 +54,19 @@ def main(): 'Topic :: Utilities', 'Programming Language :: Python'], packages=['py', - '_py', - '_py.cmdline', - '_py.code', - '_py.compat', - '_py.io', - '_py.log', - '_py.path', - '_py.process', - '_py.test', - '_py.test.dist', - '_py.test.looponfail', - '_py.test.plugin',], + 'py.plugin', + 'py.impl', + 'py.impl.cmdline', + 'py.impl.code', + 'py.impl.compat', + 'py.impl.io', + 'py.impl.log', + 'py.impl.path', + 'py.impl.process', + 'py.impl.test', + 'py.impl.test.dist', + 'py.impl.test.looponfail', + ], zip_safe=False, ) diff --git a/testing/cmdline/test_convert_unittest.py b/testing/cmdline/test_convert_unittest.py index 1d434ea30..ae5a3f4b6 100644 --- a/testing/cmdline/test_convert_unittest.py +++ b/testing/cmdline/test_convert_unittest.py @@ -1,4 +1,4 @@ -from _py.cmdline.pyconvert_unittest import rewrite_utest +from py.impl.cmdline.pyconvert_unittest import rewrite_utest class Test_UTestConvert: diff --git a/testing/code/test_assertion.py b/testing/code/test_assertion.py index c84add999..009a6a302 100644 --- a/testing/code/test_assertion.py +++ b/testing/code/test_assertion.py @@ -137,7 +137,7 @@ def test_assert_with_brokenrepr_arg(): class TestView: def setup_class(cls): - cls.View = py.test.importorskip("_py.code._assertionold").View + cls.View = py.test.importorskip("py.impl.code._assertionold").View def test_class_dispatch(self): ### Use a custom class hierarchy with existing instances diff --git a/testing/code/test_code.py b/testing/code/test_code.py index 673342513..9cae15a45 100644 --- a/testing/code/test_code.py +++ b/testing/code/test_code.py @@ -1,7 +1,7 @@ from __future__ import generators import py import sys -from _py.code.code import safe_repr +from py.impl.code.code import safe_repr failsonjython = py.test.mark.xfail("sys.platform.startswith('java')") @@ -163,7 +163,7 @@ class TestSafeRepr: assert 'TypeError' in safe_repr(BrokenRepr("string")) def test_big_repr(self): - from _py.code.code import SafeRepr + from py.impl.code.code import SafeRepr assert len(safe_repr(range(1000))) <= \ len('[' + SafeRepr().maxlist * "1000" + ']') diff --git a/testing/code/test_excinfo.py b/testing/code/test_excinfo.py index 0c3314a95..e4ba4da3a 100644 --- a/testing/code/test_excinfo.py +++ b/testing/code/test_excinfo.py @@ -1,6 +1,6 @@ import py -from _py.code.code import FormattedExcinfo, ReprExceptionInfo +from py.impl.code.code import FormattedExcinfo, ReprExceptionInfo queue = py.builtin._tryimport('queue', 'Queue') class TWMock: diff --git a/testing/code/test_source.py b/testing/code/test_source.py index c3d1fe1ec..f7d92ddf1 100644 --- a/testing/code/test_source.py +++ b/testing/code/test_source.py @@ -290,7 +290,7 @@ def test_getfuncsource_with_multine_string(): def test_deindent(): - from _py.code.source import deindent as deindent + from py.impl.code.source import deindent as deindent assert deindent(['\tfoo', '\tbar', ]) == ['foo', 'bar'] def f(): @@ -329,27 +329,27 @@ if True: pass def test_getsource_fallback(): - from _py.code.source import getsource + from py.impl.code.source import getsource expected = """def x(): pass""" src = getsource(x) assert src == expected def test_idem_compile_and_getsource(): - from _py.code.source import getsource + from py.impl.code.source import getsource expected = "def x(): pass" co = py.code.compile(expected) src = getsource(co) assert src == expected def test_findsource_fallback(): - from _py.code.source import findsource + from py.impl.code.source import findsource src, lineno = findsource(x) assert 'test_findsource_simple' in str(src) assert src[lineno] == ' def x():' def test_findsource___source__(): - from _py.code.source import findsource + from py.impl.code.source import findsource co = py.code.compile("""if 1: def x(): pass diff --git a/testing/io_/test_capture.py b/testing/io_/test_capture.py index d5e2b6195..bcd85c3f2 100644 --- a/testing/io_/test_capture.py +++ b/testing/io_/test_capture.py @@ -58,7 +58,7 @@ def test_bytes_io(): assert s == tobytes("hello") def test_dontreadfrominput(): - from _py.io.capture import DontReadFromInput + from py.impl.io.capture import DontReadFromInput f = DontReadFromInput() assert not f.isatty() py.test.raises(IOError, f.read) diff --git a/testing/io_/test_terminalwriter.py b/testing/io_/test_terminalwriter.py index bc4c172eb..c13ae2ee4 100644 --- a/testing/io_/test_terminalwriter.py +++ b/testing/io_/test_terminalwriter.py @@ -1,6 +1,6 @@ import py import os, sys -from _py.io import terminalwriter +from py.impl.io import terminalwriter def test_terminal_width_COLUMNS(monkeypatch): """ Dummy test for get_terminal_width diff --git a/testing/log/test_log.py b/testing/log/test_log.py index 20168d25f..85de849ac 100644 --- a/testing/log/test_log.py +++ b/testing/log/test_log.py @@ -1,7 +1,7 @@ import py import sys -from _py.log.log import default_keywordmapper +from py.impl.log.log import default_keywordmapper callcapture = py.io.StdCapture.call diff --git a/testing/path/conftest.py b/testing/path/conftest.py index 7b99eb9fb..b961f9ca5 100644 --- a/testing/path/conftest.py +++ b/testing/path/conftest.py @@ -1,5 +1,5 @@ import py -from _py.path import svnwc as svncommon +from py.impl.path import svnwc as svncommon svnbin = py.path.local.sysfind('svn') repodump = py.path.local(__file__).dirpath('repotest.dump') diff --git a/testing/path/svntestbase.py b/testing/path/svntestbase.py index 0196809be..ebafe920c 100644 --- a/testing/path/svntestbase.py +++ b/testing/path/svntestbase.py @@ -1,6 +1,6 @@ import sys import py -from _py.path import svnwc as svncommon +from py.impl.path import svnwc as svncommon from testing.path.common import CommonFSTests class CommonSvnTests(CommonFSTests): diff --git a/testing/path/test_cacheutil.py b/testing/path/test_cacheutil.py index deb5f2bf9..38ca4fcf5 100644 --- a/testing/path/test_cacheutil.py +++ b/testing/path/test_cacheutil.py @@ -1,5 +1,5 @@ import py -from _py.path import cacheutil +from py.impl.path import cacheutil class BasicCacheAPITest: cache = None diff --git a/testing/path/test_svnurl.py b/testing/path/test_svnurl.py index 438ce6bbc..b99a93eeb 100644 --- a/testing/path/test_svnurl.py +++ b/testing/path/test_svnurl.py @@ -1,5 +1,5 @@ import py -from _py.path.svnurl import InfoSvnCommand +from py.impl.path.svnurl import InfoSvnCommand import datetime import time from testing.path.svntestbase import CommonSvnTests diff --git a/testing/path/test_svnwc.py b/testing/path/test_svnwc.py index de612b720..b036ce604 100644 --- a/testing/path/test_svnwc.py +++ b/testing/path/test_svnwc.py @@ -1,7 +1,7 @@ import py import sys -from _py.path.svnwc import InfoSvnWCCommand, XMLWCStatus, parse_wcinfotime -from _py.path import svnwc as svncommon +from py.impl.path.svnwc import InfoSvnWCCommand, XMLWCStatus, parse_wcinfotime +from py.impl.path import svnwc as svncommon from testing.path.svntestbase import CommonSvnTests if sys.platform == 'win32': diff --git a/testing/plugin/__init__.py b/testing/plugin/__init__.py new file mode 100644 index 000000000..792d60054 --- /dev/null +++ b/testing/plugin/__init__.py @@ -0,0 +1 @@ +# diff --git a/testing/pytest/plugin/conftest.py b/testing/plugin/conftest.py similarity index 89% rename from testing/pytest/plugin/conftest.py rename to testing/plugin/conftest.py index 0a4a26595..97d167f18 100644 --- a/testing/pytest/plugin/conftest.py +++ b/testing/plugin/conftest.py @@ -1,8 +1,9 @@ import py pytest_plugins = "pytester" -plugindir = py._impldir.join('test', 'plugin') -from _py.test.defaultconftest import pytest_plugins as default_plugins +import py.plugin +plugindir = py.path.local(py.plugin.__file__).dirpath() +from py.impl.test.defaultconftest import pytest_plugins as default_plugins def pytest_collect_file(path, parent): if path.basename.startswith("pytest_") and path.ext == ".py": diff --git a/testing/pytest/plugin/test_pytest__pytest.py b/testing/plugin/test_pytest__pytest.py similarity index 96% rename from testing/pytest/plugin/test_pytest__pytest.py rename to testing/plugin/test_pytest__pytest.py index 70aae80de..2aaa57f52 100644 --- a/testing/pytest/plugin/test_pytest__pytest.py +++ b/testing/plugin/test_pytest__pytest.py @@ -1,5 +1,5 @@ import py -from _py.test.plugin.pytest__pytest import HookRecorder +from py.plugin.pytest__pytest import HookRecorder def test_hookrecorder_basic(): comregistry = py._com.Registry() diff --git a/testing/pytest/plugin/test_pytest_assertion.py b/testing/plugin/test_pytest_assertion.py similarity index 100% rename from testing/pytest/plugin/test_pytest_assertion.py rename to testing/plugin/test_pytest_assertion.py diff --git a/testing/pytest/plugin/test_pytest_capture.py b/testing/plugin/test_pytest_capture.py similarity index 99% rename from testing/pytest/plugin/test_pytest_capture.py rename to testing/plugin/test_pytest_capture.py index 8af1867f2..433800ec6 100644 --- a/testing/pytest/plugin/test_pytest_capture.py +++ b/testing/plugin/test_pytest_capture.py @@ -1,5 +1,5 @@ import py, os, sys -from _py.test.plugin.pytest_capture import CaptureManager +from py.plugin.pytest_capture import CaptureManager needsosdup = py.test.mark.xfail("not hasattr(os, 'dup')") diff --git a/testing/pytest/plugin/test_pytest_default.py b/testing/plugin/test_pytest_default.py similarity index 94% rename from testing/pytest/plugin/test_pytest_default.py rename to testing/plugin/test_pytest_default.py index d3c3e305e..f6f2824c0 100644 --- a/testing/pytest/plugin/test_pytest_default.py +++ b/testing/plugin/test_pytest_default.py @@ -1,5 +1,5 @@ import py -from _py.test.plugin.pytest_default import pytest_report_iteminfo +from py.plugin.pytest_default import pytest_report_iteminfo def test_implied_different_sessions(tmpdir): def x(*args): @@ -50,7 +50,7 @@ class TestDistOptions: def test_getrsyncdirs(self, testdir): config = testdir.parseconfigure('--rsyncdir=' + str(testdir.tmpdir)) roots = config.getrsyncdirs() - assert len(roots) == 1 + 2 + assert len(roots) == 1 + len(py._pydirs) assert testdir.tmpdir in roots def test_getrsyncdirs_with_conftest(self, testdir): @@ -62,7 +62,7 @@ class TestDistOptions: """) config = testdir.parseconfigure(testdir.tmpdir, '--rsyncdir=y', '--rsyncdir=z') roots = config.getrsyncdirs() - assert len(roots) == 3 + 2 + assert len(roots) == 3 + len(py._pydirs) assert py.path.local('y') in roots assert py.path.local('z') in roots assert testdir.tmpdir.join('x') in roots diff --git a/testing/pytest/plugin/test_pytest_doctest.py b/testing/plugin/test_pytest_doctest.py similarity index 96% rename from testing/pytest/plugin/test_pytest_doctest.py rename to testing/plugin/test_pytest_doctest.py index c55715b5b..cb9ac4096 100644 --- a/testing/pytest/plugin/test_pytest_doctest.py +++ b/testing/plugin/test_pytest_doctest.py @@ -1,4 +1,4 @@ -from _py.test.plugin.pytest_doctest import DoctestModule, DoctestTextfile +from py.plugin.pytest_doctest import DoctestModule, DoctestTextfile class TestDoctests: @@ -33,7 +33,7 @@ class TestDoctests: reprec.assertoutcome(failed=1) def test_doctest_unexpected_exception(self, testdir): - from _py.test.outcome import Failed + from py.impl.test.outcome import Failed p = testdir.maketxtfile(""" >>> i = 0 diff --git a/testing/pytest/plugin/test_pytest_figleaf.py b/testing/plugin/test_pytest_figleaf.py similarity index 100% rename from testing/pytest/plugin/test_pytest_figleaf.py rename to testing/plugin/test_pytest_figleaf.py diff --git a/testing/pytest/plugin/test_pytest_helpconfig.py b/testing/plugin/test_pytest_helpconfig.py similarity index 100% rename from testing/pytest/plugin/test_pytest_helpconfig.py rename to testing/plugin/test_pytest_helpconfig.py diff --git a/testing/pytest/plugin/test_pytest_hooklog.py b/testing/plugin/test_pytest_hooklog.py similarity index 100% rename from testing/pytest/plugin/test_pytest_hooklog.py rename to testing/plugin/test_pytest_hooklog.py diff --git a/testing/pytest/plugin/test_pytest_mark.py b/testing/plugin/test_pytest_mark.py similarity index 98% rename from testing/pytest/plugin/test_pytest_mark.py rename to testing/plugin/test_pytest_mark.py index ee1de5857..5584d8d6c 100644 --- a/testing/pytest/plugin/test_pytest_mark.py +++ b/testing/plugin/test_pytest_mark.py @@ -1,5 +1,5 @@ import py -from _py.test.plugin.pytest_mark import Mark +from py.plugin.pytest_mark import Mark class TestMark: def test_pytest_mark_notcallable(self): diff --git a/testing/pytest/plugin/test_pytest_monkeypatch.py b/testing/plugin/test_pytest_monkeypatch.py similarity index 98% rename from testing/pytest/plugin/test_pytest_monkeypatch.py rename to testing/plugin/test_pytest_monkeypatch.py index 14f30efda..e7cf16d42 100644 --- a/testing/pytest/plugin/test_pytest_monkeypatch.py +++ b/testing/plugin/test_pytest_monkeypatch.py @@ -1,6 +1,6 @@ import os, sys import py -from _py.test.plugin.pytest_monkeypatch import MonkeyPatch +from py.plugin.pytest_monkeypatch import MonkeyPatch def test_setattr(): class A: diff --git a/testing/pytest/plugin/test_pytest_nose.py b/testing/plugin/test_pytest_nose.py similarity index 100% rename from testing/pytest/plugin/test_pytest_nose.py rename to testing/plugin/test_pytest_nose.py diff --git a/testing/pytest/plugin/test_pytest_pastebin.py b/testing/plugin/test_pytest_pastebin.py similarity index 100% rename from testing/pytest/plugin/test_pytest_pastebin.py rename to testing/plugin/test_pytest_pastebin.py diff --git a/testing/pytest/plugin/test_pytest_pdb.py b/testing/plugin/test_pytest_pdb.py similarity index 100% rename from testing/pytest/plugin/test_pytest_pdb.py rename to testing/plugin/test_pytest_pdb.py diff --git a/testing/pytest/plugin/test_pytest_pytester.py b/testing/plugin/test_pytest_pytester.py similarity index 96% rename from testing/pytest/plugin/test_pytest_pytester.py rename to testing/plugin/test_pytest_pytester.py index 0c7d25ffe..dee03686b 100644 --- a/testing/pytest/plugin/test_pytest_pytester.py +++ b/testing/plugin/test_pytest_pytester.py @@ -1,5 +1,5 @@ import py -from _py.test.plugin.pytest_pytester import LineMatcher, LineComp +from py.plugin.pytest_pytester import LineMatcher, LineComp def test_reportrecorder(testdir): registry = py._com.Registry() diff --git a/testing/pytest/plugin/test_pytest_recwarn.py b/testing/plugin/test_pytest_recwarn.py similarity index 97% rename from testing/pytest/plugin/test_pytest_recwarn.py rename to testing/plugin/test_pytest_recwarn.py index 7b9a3992c..20a29bad8 100644 --- a/testing/pytest/plugin/test_pytest_recwarn.py +++ b/testing/plugin/test_pytest_recwarn.py @@ -1,5 +1,5 @@ import py -from _py.test.plugin.pytest_recwarn import WarningsRecorder +from py.plugin.pytest_recwarn import WarningsRecorder def test_WarningRecorder(): showwarning = py.std.warnings.showwarning diff --git a/testing/pytest/plugin/test_pytest_restdoc.py b/testing/plugin/test_pytest_restdoc.py similarity index 96% rename from testing/pytest/plugin/test_pytest_restdoc.py rename to testing/plugin/test_pytest_restdoc.py index 7fd117f17..e0f452a4b 100644 --- a/testing/pytest/plugin/test_pytest_restdoc.py +++ b/testing/plugin/test_pytest_restdoc.py @@ -1,4 +1,4 @@ -from _py.test.plugin.pytest_restdoc import deindent +from py.plugin.pytest_restdoc import deindent def test_deindent(): assert deindent('foo') == 'foo' @@ -13,7 +13,7 @@ class TestApigenLinkRole: # these tests are moved here from the former py/doc/conftest.py def test_resolve_linkrole(self): - from _py.doc.conftest import get_apigen_relpath + from py.impl.doc.conftest import get_apigen_relpath apigen_relpath = get_apigen_relpath() assert resolve_linkrole('api', 'py.foo.bar', False) == ( @@ -46,7 +46,7 @@ class TestDoctest: testdir = request.getfuncargvalue("testdir") assert request.module.__name__ == __name__ testdir.makepyfile(confrest= - "from _py.test.plugin.pytest_restdoc import Project") + "from py.plugin.pytest_restdoc import Project") for p in testdir.plugins: if p == globals(): break diff --git a/testing/pytest/plugin/test_pytest_resultlog.py b/testing/plugin/test_pytest_resultlog.py similarity index 97% rename from testing/pytest/plugin/test_pytest_resultlog.py rename to testing/plugin/test_pytest_resultlog.py index fd64b84bf..d721b2e3b 100644 --- a/testing/pytest/plugin/test_pytest_resultlog.py +++ b/testing/plugin/test_pytest_resultlog.py @@ -1,7 +1,7 @@ import py import os -from _py.test.plugin.pytest_resultlog import generic_path, ResultLog -from _py.test.collect import Node, Item, FSCollector +from py.plugin.pytest_resultlog import generic_path, ResultLog +from py.impl.test.collect import Node, Item, FSCollector def test_generic_path(): p1 = Node('a') diff --git a/testing/pytest/plugin/test_pytest_runner.py b/testing/plugin/test_pytest_runner.py similarity index 97% rename from testing/pytest/plugin/test_pytest_runner.py rename to testing/plugin/test_pytest_runner.py index 641ff59f8..114553f5e 100644 --- a/testing/pytest/plugin/test_pytest_runner.py +++ b/testing/plugin/test_pytest_runner.py @@ -1,6 +1,6 @@ import py -from _py.test.plugin import pytest_runner as runner -from _py.code.code import ReprExceptionInfo +from py.plugin import pytest_runner as runner +from py.impl.code.code import ReprExceptionInfo class TestSetupState: def test_setup(self, testdir): @@ -187,10 +187,10 @@ class BaseFunctionalTests: assert rep.when == "call" def test_exit_propagates(self, testdir): - from _py.test.outcome import Exit + from py.impl.test.outcome import Exit try: testdir.runitem(""" - from _py.test.outcome import Exit + from py.impl.test.outcome import Exit def test_func(): raise Exit() """) @@ -206,7 +206,7 @@ class TestExecutionNonForked(BaseFunctionalTests): return f def test_keyboardinterrupt_propagates(self, testdir): - from _py.test.outcome import Exit + from py.impl.test.outcome import Exit try: testdir.runitem(""" def test_func(): diff --git a/testing/pytest/plugin/test_pytest_runner_xunit.py b/testing/plugin/test_pytest_runner_xunit.py similarity index 100% rename from testing/pytest/plugin/test_pytest_runner_xunit.py rename to testing/plugin/test_pytest_runner_xunit.py diff --git a/testing/pytest/plugin/test_pytest_skipping.py b/testing/plugin/test_pytest_skipping.py similarity index 96% rename from testing/pytest/plugin/test_pytest_skipping.py rename to testing/plugin/test_pytest_skipping.py index 74524c935..74d860ab5 100644 --- a/testing/pytest/plugin/test_pytest_skipping.py +++ b/testing/plugin/test_pytest_skipping.py @@ -104,7 +104,7 @@ def test_skipif_class(testdir): ]) def test_evalexpression_cls_config_example(testdir): - from _py.test.plugin.pytest_skipping import evalexpression + from py.plugin.pytest_skipping import evalexpression item, = testdir.getitems(""" import py class TestClass: @@ -118,8 +118,8 @@ def test_evalexpression_cls_config_example(testdir): assert y == 3 def test_skip_reasons_folding(): - from _py.test.plugin import pytest_runner as runner - from _py.test.plugin.pytest_skipping import folded_skips + from py.plugin import pytest_runner as runner + from py.plugin.pytest_skipping import folded_skips class longrepr: class reprcrash: path = 'xyz' diff --git a/testing/pytest/plugin/test_pytest_terminal.py b/testing/plugin/test_pytest_terminal.py similarity index 99% rename from testing/pytest/plugin/test_pytest_terminal.py rename to testing/plugin/test_pytest_terminal.py index c11052949..aec9eed05 100644 --- a/testing/pytest/plugin/test_pytest_terminal.py +++ b/testing/plugin/test_pytest_terminal.py @@ -13,9 +13,9 @@ except ImportError: # # =============================================================================== -from _py.test.plugin.pytest_terminal import TerminalReporter, \ +from py.plugin.pytest_terminal import TerminalReporter, \ CollectonlyReporter, repr_pythonversion, getreportopt -from _py.test.plugin import pytest_runner as runner +from py.plugin import pytest_runner as runner def basic_run_report(item): return runner.call_and_report(item, "call", log=False) @@ -360,7 +360,7 @@ class TestCollectonly: """) result = testdir.runpytest("--collectonly", p) stderr = result.stderr.str().strip() - assert stderr.startswith("inserting into sys.path") + #assert stderr.startswith("inserting into sys.path") assert result.ret == 0 extra = result.stdout.fnmatch_lines(py.code.Source(""" diff --git a/testing/pytest/plugin/test_pytest_tmpdir.py b/testing/plugin/test_pytest_tmpdir.py similarity index 67% rename from testing/pytest/plugin/test_pytest_tmpdir.py rename to testing/plugin/test_pytest_tmpdir.py index 788432eeb..a3a9ae76f 100644 --- a/testing/pytest/plugin/test_pytest_tmpdir.py +++ b/testing/plugin/test_pytest_tmpdir.py @@ -1,7 +1,7 @@ -from _py.test.plugin.pytest_tmpdir import pytest_funcarg__tmpdir +from py.plugin.pytest_tmpdir import pytest_funcarg__tmpdir def test_funcarg(testdir): - from _py.test.funcargs import FuncargRequest + from py.impl.test.funcargs import FuncargRequest item = testdir.getitem("def test_func(tmpdir): pass") p = pytest_funcarg__tmpdir(FuncargRequest(item)) assert p.check() diff --git a/testing/pytest/plugin/test_pytest_unittest.py b/testing/plugin/test_pytest_unittest.py similarity index 100% rename from testing/pytest/plugin/test_pytest_unittest.py rename to testing/plugin/test_pytest_unittest.py diff --git a/testing/pytest/dist/test_dsession.py b/testing/pytest/dist/test_dsession.py index 9bcbe3026..11514ff46 100644 --- a/testing/pytest/dist/test_dsession.py +++ b/testing/pytest/dist/test_dsession.py @@ -1,5 +1,5 @@ -from _py.test.dist.dsession import DSession -from _py.test import outcome +from py.impl.test.dist.dsession import DSession +from py.impl.test import outcome import py import execnet diff --git a/testing/pytest/dist/test_gwmanage.py b/testing/pytest/dist/test_gwmanage.py index 82c20a422..0ab3b6f5a 100644 --- a/testing/pytest/dist/test_gwmanage.py +++ b/testing/pytest/dist/test_gwmanage.py @@ -7,8 +7,8 @@ import py import os -from _py.test.dist.gwmanage import GatewayManager, HostRSync -from _py.test.plugin import hookspec +from py.impl.test.dist.gwmanage import GatewayManager, HostRSync +from py.plugin import hookspec import execnet def pytest_funcarg__hookrecorder(request): diff --git a/testing/pytest/dist/test_mypickle.py b/testing/pytest/dist/test_mypickle.py index bf4e9c3fa..cff9b7087 100644 --- a/testing/pytest/dist/test_mypickle.py +++ b/testing/pytest/dist/test_mypickle.py @@ -5,8 +5,8 @@ import execnet Queue = py.builtin._tryimport('queue', 'Queue').Queue -from _py.test.dist.mypickle import ImmutablePickler, PickleChannel -from _py.test.dist.mypickle import UnpickleError, makekey +from py.impl.test.dist.mypickle import ImmutablePickler, PickleChannel +from py.impl.test.dist.mypickle import UnpickleError, makekey # first let's test some basic functionality def pytest_generate_tests(metafunc): @@ -119,16 +119,16 @@ TESTTIMEOUT = 2.0 class TestPickleChannelFunctional: def setup_class(cls): cls.gw = execnet.PopenGateway() - cls.gw.remote_init_threads(5) - # we need the remote test code to import - # the same test module here cls.gw.remote_exec( "import py ; py.path.local(%r).pyimport()" %(__file__) ) + cls.gw.remote_init_threads(5) + # we need the remote test code to import + # the same test module here def test_popen_send_instance(self): channel = self.gw.remote_exec(""" - from _py.test.dist.mypickle import PickleChannel + from py.impl.test.dist.mypickle import PickleChannel channel = PickleChannel(channel) from testing.pytest.dist.test_mypickle import A a1 = A() @@ -147,7 +147,7 @@ class TestPickleChannelFunctional: def test_send_concurrent(self): channel = self.gw.remote_exec(""" - from _py.test.dist.mypickle import PickleChannel + from py.impl.test.dist.mypickle import PickleChannel channel = PickleChannel(channel) from testing.pytest.dist.test_mypickle import A l = [A() for i in range(10)] @@ -177,7 +177,7 @@ class TestPickleChannelFunctional: def test_popen_with_callback(self): channel = self.gw.remote_exec(""" - from _py.test.dist.mypickle import PickleChannel + from py.impl.test.dist.mypickle import PickleChannel channel = PickleChannel(channel) from testing.pytest.dist.test_mypickle import A a1 = A() @@ -198,7 +198,7 @@ class TestPickleChannelFunctional: def test_popen_with_callback_with_endmarker(self): channel = self.gw.remote_exec(""" - from _py.test.dist.mypickle import PickleChannel + from py.impl.test.dist.mypickle import PickleChannel channel = PickleChannel(channel) from testing.pytest.dist.test_mypickle import A a1 = A() @@ -222,7 +222,7 @@ class TestPickleChannelFunctional: def test_popen_with_callback_with_endmarker_and_unpickling_error(self): channel = self.gw.remote_exec(""" - from _py.test.dist.mypickle import PickleChannel + from py.impl.test.dist.mypickle import PickleChannel channel = PickleChannel(channel) from testing.pytest.dist.test_mypickle import A a1 = A() @@ -241,7 +241,7 @@ class TestPickleChannelFunctional: def test_popen_with_newchannel(self): channel = self.gw.remote_exec(""" - from _py.test.dist.mypickle import PickleChannel + from py.impl.test.dist.mypickle import PickleChannel channel = PickleChannel(channel) newchannel = channel.receive() newchannel.send(42) @@ -255,7 +255,7 @@ class TestPickleChannelFunctional: def test_popen_with_various_methods(self): channel = self.gw.remote_exec(""" - from _py.test.dist.mypickle import PickleChannel + from py.impl.test.dist.mypickle import PickleChannel channel = PickleChannel(channel) channel.receive() """) diff --git a/testing/pytest/dist/test_nodemanage.py b/testing/pytest/dist/test_nodemanage.py index 4ae0258dc..e40f8ad02 100644 --- a/testing/pytest/dist/test_nodemanage.py +++ b/testing/pytest/dist/test_nodemanage.py @@ -1,5 +1,5 @@ import py -from _py.test.dist.nodemanage import NodeManager +from py.impl.test.dist.nodemanage import NodeManager class pytest_funcarg__mysetup: def __init__(self, request): diff --git a/testing/pytest/dist/test_txnode.py b/testing/pytest/dist/test_txnode.py index 867e39bff..62c8423ad 100644 --- a/testing/pytest/dist/test_txnode.py +++ b/testing/pytest/dist/test_txnode.py @@ -1,7 +1,7 @@ import py import execnet -from _py.test.dist.txnode import TXNode +from py.impl.test.dist.txnode import TXNode queue = py.builtin._tryimport("queue", "Queue") Queue = queue.Queue diff --git a/testing/pytest/looponfail/test_remote.py b/testing/pytest/looponfail/test_remote.py index 6923214e8..121d45d41 100644 --- a/testing/pytest/looponfail/test_remote.py +++ b/testing/pytest/looponfail/test_remote.py @@ -1,6 +1,6 @@ import py py.test.importorskip("execnet") -from _py.test.looponfail.remote import LooponfailingSession, LoopState, RemoteControl +from py.impl.test.looponfail.remote import LooponfailingSession, LoopState, RemoteControl class TestRemoteControl: def test_nofailures(self, testdir): diff --git a/testing/pytest/looponfail/test_util.py b/testing/pytest/looponfail/test_util.py index b57fc4845..e83e09978 100644 --- a/testing/pytest/looponfail/test_util.py +++ b/testing/pytest/looponfail/test_util.py @@ -1,5 +1,5 @@ import py -from _py.test.looponfail.util import StatRecorder +from py.impl.test.looponfail.util import StatRecorder def test_filechange(tmpdir): tmp = tmpdir diff --git a/testing/pytest/test_collect.py b/testing/pytest/test_collect.py index e4b44fedb..512008029 100644 --- a/testing/pytest/test_collect.py +++ b/testing/pytest/test_collect.py @@ -2,7 +2,7 @@ import py class TestCollector: def test_collect_versus_item(self): - from _py.test.collect import Collector, Item + from py.impl.test.collect import Collector, Item assert not issubclass(Collector, Item) assert not issubclass(Item, Collector) diff --git a/testing/pytest/test_compat.py b/testing/pytest/test_compat.py index 88a7547ed..2c39ef4e1 100644 --- a/testing/pytest/test_compat.py +++ b/testing/pytest/test_compat.py @@ -1,7 +1,7 @@ from __future__ import generators import py -from _py.test.compat import TestCase -from _py.test.outcome import Failed +from py.impl.test.compat import TestCase +from py.impl.test.outcome import Failed class TestCompatTestCaseSetupSemantics(TestCase): globlist = [] diff --git a/testing/pytest/test_config.py b/testing/pytest/test_config.py index 4793ba310..7e031546e 100644 --- a/testing/pytest/test_config.py +++ b/testing/pytest/test_config.py @@ -107,7 +107,7 @@ class TestConfigAPI: py.test.raises(KeyError, 'config.getvalue("y", o)') def test_config_getvalueorskip(self, testdir): - from _py.test.outcome import Skipped + from py.impl.test.outcome import Skipped config = testdir.parseconfig() py.test.raises(Skipped, "config.getvalueorskip('hello')") verbose = config.getvalueorskip("verbose") @@ -229,7 +229,7 @@ class TestOptionEffects: class TestConfig_gettopdir: def test_gettopdir(self, testdir): - from _py.test.config import gettopdir + from py.impl.test.config import gettopdir tmp = testdir.tmpdir assert gettopdir([tmp]) == tmp topdir = gettopdir([tmp.join("hello"), tmp.join("world")]) @@ -238,7 +238,7 @@ class TestConfig_gettopdir: assert gettopdir([somefile]) == tmp def test_gettopdir_pypkg(self, testdir): - from _py.test.config import gettopdir + from py.impl.test.config import gettopdir tmp = testdir.tmpdir a = tmp.ensure('a', dir=1) b = tmp.ensure('a', 'b', '__init__.py') diff --git a/testing/pytest/test_conftesthandle.py b/testing/pytest/test_conftesthandle.py index 75a56112b..bd476bca3 100644 --- a/testing/pytest/test_conftesthandle.py +++ b/testing/pytest/test_conftesthandle.py @@ -1,5 +1,5 @@ import py -from _py.test.conftesthandle import Conftest +from py.impl.test.conftesthandle import Conftest def pytest_generate_tests(metafunc): if "basedir" in metafunc.funcargnames: diff --git a/testing/pytest/test_funcargs.py b/testing/pytest/test_funcargs.py index b640fb7fb..64072d77d 100644 --- a/testing/pytest/test_funcargs.py +++ b/testing/pytest/test_funcargs.py @@ -1,5 +1,5 @@ import py, sys -from _py.test import funcargs +from py.impl.test import funcargs def test_getfuncargnames(): def f(): pass diff --git a/testing/pytest/test_outcome.py b/testing/pytest/test_outcome.py index dec5ced67..146c61e8a 100644 --- a/testing/pytest/test_outcome.py +++ b/testing/pytest/test_outcome.py @@ -31,7 +31,7 @@ def test_exception_printing_skip(): assert s.startswith("Skipped") def test_importorskip(): - from _py.test.outcome import Skipped, importorskip + from py.impl.test.outcome import Skipped, importorskip assert importorskip == py.test.importorskip try: sys = importorskip("sys") diff --git a/testing/pytest/test_parseopt.py b/testing/pytest/test_parseopt.py index 3e4779357..573ac04b2 100644 --- a/testing/pytest/test_parseopt.py +++ b/testing/pytest/test_parseopt.py @@ -1,5 +1,5 @@ import py -from _py.test import parseopt +from py.impl.test import parseopt class TestParser: def test_init(self, capsys): diff --git a/testing/pytest/test_pickling.py b/testing/pytest/test_pickling.py index 08392ae0a..54f5bcaf6 100644 --- a/testing/pytest/test_pickling.py +++ b/testing/pytest/test_pickling.py @@ -19,7 +19,7 @@ def pytest_funcarg__testdir(request): class ImmutablePickleTransport: def __init__(self, request): - from _py.test.dist.mypickle import ImmutablePickler + from py.impl.test.dist.mypickle import ImmutablePickler self.p1 = ImmutablePickler(uneven=0) self.p2 = ImmutablePickler(uneven=1) setglobals(request) @@ -69,7 +69,7 @@ class TestImmutablePickling: class TestConfigPickling: def test_config_getstate_setstate(self, testdir): - from _py.test.config import Config + from py.impl.test.config import Config testdir.makepyfile(__init__="", conftest="x=1; y=2") hello = testdir.makepyfile(hello="") tmp = testdir.tmpdir @@ -183,11 +183,11 @@ class TestConfigPickling: def test_config__setstate__wired_correctly_in_childprocess(testdir): execnet = py.test.importorskip("execnet") - from _py.test.dist.mypickle import PickleChannel + from py.impl.test.dist.mypickle import PickleChannel gw = execnet.PopenGateway() channel = gw.remote_exec(""" import py - from _py.test.dist.mypickle import PickleChannel + from py.impl.test.dist.mypickle import PickleChannel channel = PickleChannel(channel) config = channel.receive() assert py.test.config.pluginmanager.comregistry == py._com.comregistry, "comregistry wrong" diff --git a/testing/pytest/test_pluginmanager.py b/testing/pytest/test_pluginmanager.py index a7085bbe3..cd9d330f0 100644 --- a/testing/pytest/test_pluginmanager.py +++ b/testing/pytest/test_pluginmanager.py @@ -1,5 +1,5 @@ import py, os -from _py.test.pluginmanager import PluginManager, canonical_importname, collectattr +from py.impl.test.pluginmanager import PluginManager, canonical_importname, collectattr class TestBootstrapping: def test_consider_env_fails_to_import(self, monkeypatch): @@ -172,7 +172,7 @@ class TestBootstrapping: class TestPytestPluginInteractions: def test_do_option_conftestplugin(self, testdir): - from _py.test.config import Config + from py.impl.test.config import Config p = testdir.makepyfile(""" def pytest_addoption(parser): parser.addoption('--test123', action="store_true") @@ -200,7 +200,7 @@ class TestPytestPluginInteractions: ]) def test_do_option_postinitialize(self, testdir): - from _py.test.config import Config + from py.impl.test.config import Config config = Config() config.parse([]) config.pluginmanager.do_configure(config=config) diff --git a/testing/pytest/test_pycollect.py b/testing/pytest/test_pycollect.py index ad1ac1a77..91b0790b6 100644 --- a/testing/pytest/test_pycollect.py +++ b/testing/pytest/test_pycollect.py @@ -1,6 +1,6 @@ import py -from _py.test.outcome import Skipped +from py.impl.test.outcome import Skipped class TestModule: def test_module_file_not_found(self, testdir): diff --git a/testing/pytest/test_traceback.py b/testing/pytest/test_traceback.py index 868be6127..c14c31999 100644 --- a/testing/pytest/test_traceback.py +++ b/testing/pytest/test_traceback.py @@ -2,7 +2,7 @@ import py class TestTracebackCutting: def test_skip_simple(self): - from _py.test.outcome import Skipped + from py.impl.test.outcome import Skipped excinfo = py.test.raises(Skipped, 'py.test.skip("xxx")') assert excinfo.traceback[-1].frame.code.name == "skip" assert excinfo.traceback[-1].ishidden() diff --git a/testing/root/test_com.py b/testing/root/test_com.py index 3a9beaf2f..f6e8536c3 100644 --- a/testing/root/test_com.py +++ b/testing/root/test_com.py @@ -1,7 +1,7 @@ import py import os -from _py._com import Registry, MultiCall, HookRelay, varnames +from py.impl._com import Registry, MultiCall, HookRelay, varnames def test_varnames(): def f(x): diff --git a/testing/root/test_xmlgen.py b/testing/root/test_xmlgen.py index 0e95d1a98..f21106911 100644 --- a/testing/root/test_xmlgen.py +++ b/testing/root/test_xmlgen.py @@ -1,6 +1,6 @@ import py -from _py.xmlgen import unicode, html +from py.impl.xmlgen import unicode, html class ns(py.xml.Namespace): pass diff --git a/testing/test_py_imports.py b/testing/test_py_imports.py index be87c01d9..c14de36bd 100644 --- a/testing/test_py_imports.py +++ b/testing/test_py_imports.py @@ -25,7 +25,7 @@ def test_virtual_module_identity(): assert local1 is local2 def test_importall(): - base = py.path.local(py.__file__).dirpath() + base = py._impldir nodirs = [ base.join('test', 'testing', 'data'), base.join('test', 'web'), @@ -56,7 +56,7 @@ def test_importall(): break else: relpath = relpath.replace(base.sep, '.') - modpath = '_py.%s' % relpath + modpath = 'py.impl.%s' % relpath check_import(modpath) def check_import(modpath):