From eee0e143341179a14c96af980ca14d01696de769 Mon Sep 17 00:00:00 2001 From: holger krekel Date: Mon, 11 Oct 2010 01:14:40 +0200 Subject: [PATCH] internally switch to pytest.plugin.NAME instead of pytest.plugin.pytest_NAME --HG-- branch : trunk --- doc/funcargs.txt | 2 +- doc/monkeypatch.txt | 2 +- .../plugin/{pytest__pytest.py => _pytest.py} | 0 .../{pytest_assertion.py => assertion.py} | 0 .../plugin/{pytest_capture.py => capture.py} | 0 .../plugin/{pytest_doctest.py => doctest.py} | 26 ++------------- .../{pytest_genscript.py => genscript.py} | 0 .../{pytest_helpconfig.py => helpconfig.py} | 0 .../{pytest_junitxml.py => junitxml.py} | 0 .../plugin/{pytest_keyword.py => keyword.py} | 0 pytest/plugin/{pytest_mark.py => mark.py} | 0 .../{pytest_monkeypatch.py => monkeypatch.py} | 0 pytest/plugin/{pytest_nose.py => nose.py} | 0 .../{pytest_pastebin.py => pastebin.py} | 0 pytest/plugin/{pytest_pdb.py => pdb.py} | 0 pytest/plugin/{pytest_pylint.py => pylint.py} | 0 pytest/plugin/pytest_hooklog.py | 33 ------------------- .../{pytest_pytester.py => pytester.py} | 2 +- pytest/plugin/{pytest_python.py => python.py} | 2 +- .../plugin/{pytest_recwarn.py => recwarn.py} | 0 .../plugin/{pytest_restdoc.py => restdoc.py} | 0 .../{pytest_resultlog.py => resultlog.py} | 0 pytest/plugin/{pytest_runner.py => runner.py} | 0 .../plugin/{pytest_session.py => session.py} | 0 .../{pytest_skipping.py => skipping.py} | 0 .../{pytest_terminal.py => terminal.py} | 0 pytest/plugin/{pytest_tmpdir.py => tmpdir.py} | 0 .../{pytest_unittest.py => unittest.py} | 0 pytest/pluginmanager.py | 10 +++--- ..._pytest_assertion.py => test_assertion.py} | 2 +- ...test_pytest_capture.py => test_capture.py} | 2 +- ...test_pytest_doctest.py => test_doctest.py} | 2 +- ..._pytest_genscript.py => test_genscript.py} | 0 ...ytest_helpconfig.py => test_helpconfig.py} | 2 +- ...st_pytest_junitxml.py => test_junitxml.py} | 0 ...test_pytest_keyword.py => test_keyword.py} | 0 .../{test_pytest_mark.py => test_mark.py} | 2 +- ...est_monkeypatch.py => test_monkeypatch.py} | 2 +- .../{test_pytest_nose.py => test_nose.py} | 0 ...st_pytest_pastebin.py => test_pastebin.py} | 0 .../{test_pytest_pdb.py => test_pdb.py} | 0 testing/plugin/test_pytest__pytest.py | 2 +- testing/plugin/test_pytest_hooklog.py | 12 ------- ...st_pytest_pytester.py => test_pytester.py} | 2 +- .../{test_pytest_python.py => test_python.py} | 2 +- ...test_pytest_recwarn.py => test_recwarn.py} | 2 +- ...test_pytest_restdoc.py => test_restdoc.py} | 4 +-- ..._pytest_resultlog.py => test_resultlog.py} | 4 +-- .../{test_pytest_runner.py => test_runner.py} | 2 +- ...test_pytest_session.py => test_session.py} | 2 +- ...st_pytest_skipping.py => test_skipping.py} | 7 ++-- ...st_pytest_terminal.py => test_terminal.py} | 4 +-- .../{test_pytest_tmpdir.py => test_tmpdir.py} | 4 +-- ...st_pytest_unittest.py => test_unittest.py} | 0 testing/test_collection.py | 2 +- 55 files changed, 36 insertions(+), 102 deletions(-) rename pytest/plugin/{pytest__pytest.py => _pytest.py} (100%) rename pytest/plugin/{pytest_assertion.py => assertion.py} (100%) rename pytest/plugin/{pytest_capture.py => capture.py} (100%) rename pytest/plugin/{pytest_doctest.py => doctest.py} (82%) rename pytest/plugin/{pytest_genscript.py => genscript.py} (100%) rename pytest/plugin/{pytest_helpconfig.py => helpconfig.py} (100%) rename pytest/plugin/{pytest_junitxml.py => junitxml.py} (100%) rename pytest/plugin/{pytest_keyword.py => keyword.py} (100%) rename pytest/plugin/{pytest_mark.py => mark.py} (100%) rename pytest/plugin/{pytest_monkeypatch.py => monkeypatch.py} (100%) rename pytest/plugin/{pytest_nose.py => nose.py} (100%) rename pytest/plugin/{pytest_pastebin.py => pastebin.py} (100%) rename pytest/plugin/{pytest_pdb.py => pdb.py} (100%) rename pytest/plugin/{pytest_pylint.py => pylint.py} (100%) delete mode 100644 pytest/plugin/pytest_hooklog.py rename pytest/plugin/{pytest_pytester.py => pytester.py} (99%) rename pytest/plugin/{pytest_python.py => python.py} (99%) rename pytest/plugin/{pytest_recwarn.py => recwarn.py} (100%) rename pytest/plugin/{pytest_restdoc.py => restdoc.py} (100%) rename pytest/plugin/{pytest_resultlog.py => resultlog.py} (100%) rename pytest/plugin/{pytest_runner.py => runner.py} (100%) rename pytest/plugin/{pytest_session.py => session.py} (100%) rename pytest/plugin/{pytest_skipping.py => skipping.py} (100%) rename pytest/plugin/{pytest_terminal.py => terminal.py} (100%) rename pytest/plugin/{pytest_tmpdir.py => tmpdir.py} (100%) rename pytest/plugin/{pytest_unittest.py => unittest.py} (100%) rename testing/plugin/{test_pytest_assertion.py => test_assertion.py} (99%) rename testing/plugin/{test_pytest_capture.py => test_capture.py} (99%) rename testing/plugin/{test_pytest_doctest.py => test_doctest.py} (97%) rename testing/plugin/{test_pytest_genscript.py => test_genscript.py} (100%) rename testing/plugin/{test_pytest_helpconfig.py => test_helpconfig.py} (96%) rename testing/plugin/{test_pytest_junitxml.py => test_junitxml.py} (100%) rename testing/plugin/{test_pytest_keyword.py => test_keyword.py} (100%) rename testing/plugin/{test_pytest_mark.py => test_mark.py} (98%) rename testing/plugin/{test_pytest_monkeypatch.py => test_monkeypatch.py} (98%) rename testing/plugin/{test_pytest_nose.py => test_nose.py} (100%) rename testing/plugin/{test_pytest_pastebin.py => test_pastebin.py} (100%) rename testing/plugin/{test_pytest_pdb.py => test_pdb.py} (100%) delete mode 100644 testing/plugin/test_pytest_hooklog.py rename testing/plugin/{test_pytest_pytester.py => test_pytester.py} (96%) rename testing/plugin/{test_pytest_python.py => test_python.py} (99%) rename testing/plugin/{test_pytest_recwarn.py => test_recwarn.py} (97%) rename testing/plugin/{test_pytest_restdoc.py => test_restdoc.py} (96%) rename testing/plugin/{test_pytest_resultlog.py => test_resultlog.py} (98%) rename testing/plugin/{test_pytest_runner.py => test_runner.py} (99%) rename testing/plugin/{test_pytest_session.py => test_session.py} (99%) rename testing/plugin/{test_pytest_skipping.py => test_skipping.py} (98%) rename testing/plugin/{test_pytest_terminal.py => test_terminal.py} (99%) rename testing/plugin/{test_pytest_tmpdir.py => test_tmpdir.py} (79%) rename testing/plugin/{test_pytest_unittest.py => test_unittest.py} (100%) diff --git a/doc/funcargs.txt b/doc/funcargs.txt index fdf116328..f3d4f1fcb 100644 --- a/doc/funcargs.txt +++ b/doc/funcargs.txt @@ -2,7 +2,7 @@ funcargs: creating and managing test function arguments ============================================================== -.. currentmodule:: pytest.plugin.pytest_python +.. currentmodule:: pytest.plugin.python .. _`funcarg mechanism`: diff --git a/doc/monkeypatch.txt b/doc/monkeypatch.txt index c8091d882..e4ca43ca5 100644 --- a/doc/monkeypatch.txt +++ b/doc/monkeypatch.txt @@ -2,7 +2,7 @@ monkeypatching/mocking modules and environments ================================================================ -.. currentmodule:: pytest.plugin.pytest_monkeypatch +.. currentmodule:: pytest.plugin.monkeypatch Sometimes tests need to invoke functionality which depends on global settings or which invokes code which cannot be easily diff --git a/pytest/plugin/pytest__pytest.py b/pytest/plugin/_pytest.py similarity index 100% rename from pytest/plugin/pytest__pytest.py rename to pytest/plugin/_pytest.py diff --git a/pytest/plugin/pytest_assertion.py b/pytest/plugin/assertion.py similarity index 100% rename from pytest/plugin/pytest_assertion.py rename to pytest/plugin/assertion.py diff --git a/pytest/plugin/pytest_capture.py b/pytest/plugin/capture.py similarity index 100% rename from pytest/plugin/pytest_capture.py rename to pytest/plugin/capture.py diff --git a/pytest/plugin/pytest_doctest.py b/pytest/plugin/doctest.py similarity index 82% rename from pytest/plugin/pytest_doctest.py rename to pytest/plugin/doctest.py index 45ff0ac31..b34475647 100644 --- a/pytest/plugin/pytest_doctest.py +++ b/pytest/plugin/doctest.py @@ -1,30 +1,8 @@ -""" -collect and execute doctests from modules and test files. - -Usage -------------- - -By default all files matching the ``test*.txt`` pattern will -be run through the python standard ``doctest`` module. Issue:: - - py.test --doctest-glob='*.rst' - -to change the pattern. Additionally you can trigger running of -tests in all python modules (including regular python test modules):: - - py.test --doctest-modules - -You can also make these changes permanent in your project by -putting them into a conftest.py file like this:: - - # content of conftest.py - option_doctestmodules = True - option_doctestglob = "*.rst" -""" +""" collect and execute doctests from modules and test files.""" import py from py._code.code import TerminalRepr, ReprFileLocation -import doctest +doctest = py.std.doctest def pytest_addoption(parser): group = parser.getgroup("collect") diff --git a/pytest/plugin/pytest_genscript.py b/pytest/plugin/genscript.py similarity index 100% rename from pytest/plugin/pytest_genscript.py rename to pytest/plugin/genscript.py diff --git a/pytest/plugin/pytest_helpconfig.py b/pytest/plugin/helpconfig.py similarity index 100% rename from pytest/plugin/pytest_helpconfig.py rename to pytest/plugin/helpconfig.py diff --git a/pytest/plugin/pytest_junitxml.py b/pytest/plugin/junitxml.py similarity index 100% rename from pytest/plugin/pytest_junitxml.py rename to pytest/plugin/junitxml.py diff --git a/pytest/plugin/pytest_keyword.py b/pytest/plugin/keyword.py similarity index 100% rename from pytest/plugin/pytest_keyword.py rename to pytest/plugin/keyword.py diff --git a/pytest/plugin/pytest_mark.py b/pytest/plugin/mark.py similarity index 100% rename from pytest/plugin/pytest_mark.py rename to pytest/plugin/mark.py diff --git a/pytest/plugin/pytest_monkeypatch.py b/pytest/plugin/monkeypatch.py similarity index 100% rename from pytest/plugin/pytest_monkeypatch.py rename to pytest/plugin/monkeypatch.py diff --git a/pytest/plugin/pytest_nose.py b/pytest/plugin/nose.py similarity index 100% rename from pytest/plugin/pytest_nose.py rename to pytest/plugin/nose.py diff --git a/pytest/plugin/pytest_pastebin.py b/pytest/plugin/pastebin.py similarity index 100% rename from pytest/plugin/pytest_pastebin.py rename to pytest/plugin/pastebin.py diff --git a/pytest/plugin/pytest_pdb.py b/pytest/plugin/pdb.py similarity index 100% rename from pytest/plugin/pytest_pdb.py rename to pytest/plugin/pdb.py diff --git a/pytest/plugin/pytest_pylint.py b/pytest/plugin/pylint.py similarity index 100% rename from pytest/plugin/pytest_pylint.py rename to pytest/plugin/pylint.py diff --git a/pytest/plugin/pytest_hooklog.py b/pytest/plugin/pytest_hooklog.py deleted file mode 100644 index 5a45a361b..000000000 --- a/pytest/plugin/pytest_hooklog.py +++ /dev/null @@ -1,33 +0,0 @@ -""" log invocations of extension hooks to a file. """ -import py - -def pytest_addoption(parser): - parser.addoption("--hooklog", dest="hooklog", default=None, - help="write hook calls to the given file.") - -def pytest_configure(config): - hooklog = config.getvalue("hooklog") - if hooklog: - config._hooklogfile = open(hooklog, 'w') - config._hooklog_oldperformcall = config.hook._performcall - config.hook._performcall = (lambda name, multicall: - logged_call(name=name, multicall=multicall, config=config)) - -def logged_call(name, multicall, config): - f = config._hooklogfile - f.write("%s(**%s)\n" % (name, multicall.kwargs)) - try: - res = config._hooklog_oldperformcall(name=name, multicall=multicall) - except: - f.write("-> exception") - raise - f.write("-> %r" % (res,)) - return res - -def pytest_unconfigure(config): - try: - del config.hook.__dict__['_performcall'] - except KeyError: - pass - else: - config._hooklogfile.close() diff --git a/pytest/plugin/pytest_pytester.py b/pytest/plugin/pytester.py similarity index 99% rename from pytest/plugin/pytest_pytester.py rename to pytest/plugin/pytester.py index d1c5fed6d..9b2faca4c 100644 --- a/pytest/plugin/pytest_pytester.py +++ b/pytest/plugin/pytester.py @@ -9,7 +9,7 @@ import inspect import time from fnmatch import fnmatch from pytest._config import Config as pytestConfig -from pytest.plugin.pytest_session import Collection +from pytest.plugin.session import Collection from py.builtin import print_ def pytest_addoption(parser): diff --git a/pytest/plugin/pytest_python.py b/pytest/plugin/python.py similarity index 99% rename from pytest/plugin/pytest_python.py rename to pytest/plugin/python.py index 0f0454106..11205ae90 100644 --- a/pytest/plugin/pytest_python.py +++ b/pytest/plugin/python.py @@ -697,7 +697,7 @@ class FuncargRequest: raise self.LookupError(msg) def showfuncargs(config): - from pytest.plugin.pytest_session import Collection + from pytest.plugin.session import Collection collection = Collection(config) firstid = collection._normalizearg(config.args[0]) colitem = collection.getbyid(firstid)[0] diff --git a/pytest/plugin/pytest_recwarn.py b/pytest/plugin/recwarn.py similarity index 100% rename from pytest/plugin/pytest_recwarn.py rename to pytest/plugin/recwarn.py diff --git a/pytest/plugin/pytest_restdoc.py b/pytest/plugin/restdoc.py similarity index 100% rename from pytest/plugin/pytest_restdoc.py rename to pytest/plugin/restdoc.py diff --git a/pytest/plugin/pytest_resultlog.py b/pytest/plugin/resultlog.py similarity index 100% rename from pytest/plugin/pytest_resultlog.py rename to pytest/plugin/resultlog.py diff --git a/pytest/plugin/pytest_runner.py b/pytest/plugin/runner.py similarity index 100% rename from pytest/plugin/pytest_runner.py rename to pytest/plugin/runner.py diff --git a/pytest/plugin/pytest_session.py b/pytest/plugin/session.py similarity index 100% rename from pytest/plugin/pytest_session.py rename to pytest/plugin/session.py diff --git a/pytest/plugin/pytest_skipping.py b/pytest/plugin/skipping.py similarity index 100% rename from pytest/plugin/pytest_skipping.py rename to pytest/plugin/skipping.py diff --git a/pytest/plugin/pytest_terminal.py b/pytest/plugin/terminal.py similarity index 100% rename from pytest/plugin/pytest_terminal.py rename to pytest/plugin/terminal.py diff --git a/pytest/plugin/pytest_tmpdir.py b/pytest/plugin/tmpdir.py similarity index 100% rename from pytest/plugin/pytest_tmpdir.py rename to pytest/plugin/tmpdir.py diff --git a/pytest/plugin/pytest_unittest.py b/pytest/plugin/unittest.py similarity index 100% rename from pytest/plugin/pytest_unittest.py rename to pytest/plugin/unittest.py diff --git a/pytest/pluginmanager.py b/pytest/pluginmanager.py index e599cdbe1..c11e92b2d 100644 --- a/pytest/pluginmanager.py +++ b/pytest/pluginmanager.py @@ -142,7 +142,7 @@ class PluginManager(object): self._hints.append("skipped plugin %r: %s" %((modname, e.msg))) else: check_old_use(mod, modname) - self.register(mod) + self.register(mod, modname) self.consider_module(mod) def pytest_terminal_summary(self, terminalreporter): @@ -225,12 +225,14 @@ def importplugin(importspec): e = py.std.sys.exc_info()[1] if str(e).find(importspec) == -1: raise + name = importspec try: - return __import__("pytest.plugin.%s" %(importspec), - None, None, '__doc__') + if name.startswith("pytest_"): + name = importspec[7:] + return __import__("pytest.plugin.%s" %(name), None, None, '__doc__') except ImportError: e = py.std.sys.exc_info()[1] - if str(e).find(importspec) == -1: + if str(e).find(name) == -1: raise # show the original exception, not the failing internal one return __import__(importspec) diff --git a/testing/plugin/test_pytest_assertion.py b/testing/plugin/test_assertion.py similarity index 99% rename from testing/plugin/test_pytest_assertion.py rename to testing/plugin/test_assertion.py index 2752247dc..d1a531a7c 100644 --- a/testing/plugin/test_pytest_assertion.py +++ b/testing/plugin/test_assertion.py @@ -1,7 +1,7 @@ import sys import py -import pytest.plugin.pytest_assertion as plugin +import pytest.plugin.assertion as plugin needsnewassert = py.test.mark.skipif("sys.version_info < (2,6)") diff --git a/testing/plugin/test_pytest_capture.py b/testing/plugin/test_capture.py similarity index 99% rename from testing/plugin/test_pytest_capture.py rename to testing/plugin/test_capture.py index 0c05ec40d..825b883c6 100644 --- a/testing/plugin/test_pytest_capture.py +++ b/testing/plugin/test_capture.py @@ -1,5 +1,5 @@ import py, os, sys -from pytest.plugin.pytest_capture import CaptureManager +from pytest.plugin.capture import CaptureManager needsosdup = py.test.mark.xfail("not hasattr(os, 'dup')") diff --git a/testing/plugin/test_pytest_doctest.py b/testing/plugin/test_doctest.py similarity index 97% rename from testing/plugin/test_pytest_doctest.py rename to testing/plugin/test_doctest.py index 5407f74fb..be62a8e86 100644 --- a/testing/plugin/test_pytest_doctest.py +++ b/testing/plugin/test_doctest.py @@ -1,4 +1,4 @@ -from pytest.plugin.pytest_doctest import DoctestModule, DoctestTextfile +from pytest.plugin.doctest import DoctestModule, DoctestTextfile import py pytest_plugins = ["pytest_doctest"] diff --git a/testing/plugin/test_pytest_genscript.py b/testing/plugin/test_genscript.py similarity index 100% rename from testing/plugin/test_pytest_genscript.py rename to testing/plugin/test_genscript.py diff --git a/testing/plugin/test_pytest_helpconfig.py b/testing/plugin/test_helpconfig.py similarity index 96% rename from testing/plugin/test_pytest_helpconfig.py rename to testing/plugin/test_helpconfig.py index 5121933cf..ae49e45f0 100644 --- a/testing/plugin/test_pytest_helpconfig.py +++ b/testing/plugin/test_helpconfig.py @@ -1,5 +1,5 @@ import py, os -from pytest.plugin.pytest_helpconfig import collectattr +from pytest.plugin.helpconfig import collectattr def test_version(testdir): assert py.version == py.__version__ diff --git a/testing/plugin/test_pytest_junitxml.py b/testing/plugin/test_junitxml.py similarity index 100% rename from testing/plugin/test_pytest_junitxml.py rename to testing/plugin/test_junitxml.py diff --git a/testing/plugin/test_pytest_keyword.py b/testing/plugin/test_keyword.py similarity index 100% rename from testing/plugin/test_pytest_keyword.py rename to testing/plugin/test_keyword.py diff --git a/testing/plugin/test_pytest_mark.py b/testing/plugin/test_mark.py similarity index 98% rename from testing/plugin/test_pytest_mark.py rename to testing/plugin/test_mark.py index c3c04e355..c3e795129 100644 --- a/testing/plugin/test_pytest_mark.py +++ b/testing/plugin/test_mark.py @@ -1,5 +1,5 @@ import py -from pytest.plugin.pytest_mark import MarkGenerator as Mark +from pytest.plugin.mark import MarkGenerator as Mark class TestMark: def test_pytest_mark_notcallable(self): diff --git a/testing/plugin/test_pytest_monkeypatch.py b/testing/plugin/test_monkeypatch.py similarity index 98% rename from testing/plugin/test_pytest_monkeypatch.py rename to testing/plugin/test_monkeypatch.py index 9c83658b9..c3adfecf7 100644 --- a/testing/plugin/test_pytest_monkeypatch.py +++ b/testing/plugin/test_monkeypatch.py @@ -1,6 +1,6 @@ import os, sys import py -from pytest.plugin.pytest_monkeypatch import monkeypatch as MonkeyPatch +from pytest.plugin.monkeypatch import monkeypatch as MonkeyPatch def test_setattr(): class A: diff --git a/testing/plugin/test_pytest_nose.py b/testing/plugin/test_nose.py similarity index 100% rename from testing/plugin/test_pytest_nose.py rename to testing/plugin/test_nose.py diff --git a/testing/plugin/test_pytest_pastebin.py b/testing/plugin/test_pastebin.py similarity index 100% rename from testing/plugin/test_pytest_pastebin.py rename to testing/plugin/test_pastebin.py diff --git a/testing/plugin/test_pytest_pdb.py b/testing/plugin/test_pdb.py similarity index 100% rename from testing/plugin/test_pytest_pdb.py rename to testing/plugin/test_pdb.py diff --git a/testing/plugin/test_pytest__pytest.py b/testing/plugin/test_pytest__pytest.py index 41a7827f9..19d2bdc30 100644 --- a/testing/plugin/test_pytest__pytest.py +++ b/testing/plugin/test_pytest__pytest.py @@ -1,6 +1,6 @@ import py import os, sys -from pytest.plugin.pytest__pytest import HookRecorder +from pytest.plugin._pytest import HookRecorder from pytest.pluginmanager import Registry def test_hookrecorder_basic(): diff --git a/testing/plugin/test_pytest_hooklog.py b/testing/plugin/test_pytest_hooklog.py deleted file mode 100644 index 4b11e69b4..000000000 --- a/testing/plugin/test_pytest_hooklog.py +++ /dev/null @@ -1,12 +0,0 @@ -import py - -def test_functional(testdir): - testdir.makepyfile(""" - def test_pass(): - pass - """) - testdir.runpytest("--hooklog=hook.log") - s = testdir.tmpdir.join("hook.log").read() - assert s.find("pytest_sessionstart") != -1 - assert s.find("TestReport") != -1 - assert s.find("sessionfinish") != -1 diff --git a/testing/plugin/test_pytest_pytester.py b/testing/plugin/test_pytester.py similarity index 96% rename from testing/plugin/test_pytest_pytester.py rename to testing/plugin/test_pytester.py index d110182f2..9090a896c 100644 --- a/testing/plugin/test_pytest_pytester.py +++ b/testing/plugin/test_pytester.py @@ -1,5 +1,5 @@ import py -from pytest.plugin.pytest_pytester import LineMatcher, LineComp +from pytest.plugin.pytester import LineMatcher, LineComp def test_reportrecorder(testdir): item = testdir.getitem("def test_func(): pass") diff --git a/testing/plugin/test_pytest_python.py b/testing/plugin/test_python.py similarity index 99% rename from testing/plugin/test_pytest_python.py rename to testing/plugin/test_python.py index bef0f6111..d42024183 100644 --- a/testing/plugin/test_pytest_python.py +++ b/testing/plugin/test_python.py @@ -1,5 +1,5 @@ import py, sys -from pytest.plugin import pytest_python as funcargs +from pytest.plugin import python as funcargs class TestModule: def test_module_file_not_found(self, testdir): diff --git a/testing/plugin/test_pytest_recwarn.py b/testing/plugin/test_recwarn.py similarity index 97% rename from testing/plugin/test_pytest_recwarn.py rename to testing/plugin/test_recwarn.py index 4ce3f07e4..6848fc1dd 100644 --- a/testing/plugin/test_pytest_recwarn.py +++ b/testing/plugin/test_recwarn.py @@ -1,5 +1,5 @@ import py -from pytest.plugin.pytest_recwarn import WarningsRecorder +from pytest.plugin.recwarn import WarningsRecorder def test_WarningRecorder(recwarn): showwarning = py.std.warnings.showwarning diff --git a/testing/plugin/test_pytest_restdoc.py b/testing/plugin/test_restdoc.py similarity index 96% rename from testing/plugin/test_pytest_restdoc.py rename to testing/plugin/test_restdoc.py index 58376f719..638ec6ff3 100644 --- a/testing/plugin/test_pytest_restdoc.py +++ b/testing/plugin/test_restdoc.py @@ -1,5 +1,5 @@ import py -from pytest.plugin.pytest_restdoc import deindent +from pytest.plugin.restdoc import deindent def test_deindent(): assert deindent('foo') == 'foo' @@ -18,7 +18,7 @@ class TestDoctest: testdir.plugins.append("restdoc") assert request.module.__name__ == __name__ testdir.makepyfile(confrest= - "from pytest.plugin.pytest_restdoc import Project") + "from pytest.plugin.restdoc import Project") # we scope our confrest file so that it doesn't # conflict with another global confrest.py testdir.makepyfile(__init__="") diff --git a/testing/plugin/test_pytest_resultlog.py b/testing/plugin/test_resultlog.py similarity index 98% rename from testing/plugin/test_pytest_resultlog.py rename to testing/plugin/test_resultlog.py index d2b88f664..a09ca0234 100644 --- a/testing/plugin/test_pytest_resultlog.py +++ b/testing/plugin/test_resultlog.py @@ -1,11 +1,11 @@ import py import os -from pytest.plugin.pytest_resultlog import generic_path, ResultLog, \ +from pytest.plugin.resultlog import generic_path, ResultLog, \ pytest_configure, pytest_unconfigure from pytest.collect import Node, Item, FSCollector def test_generic_path(testdir): - from pytest.plugin.pytest_session import Collection + from pytest.plugin.session import Collection config = testdir.parseconfig() collection = Collection(config) p1 = Node('a', config=config, collection=collection) diff --git a/testing/plugin/test_pytest_runner.py b/testing/plugin/test_runner.py similarity index 99% rename from testing/plugin/test_pytest_runner.py rename to testing/plugin/test_runner.py index de8b1fd8b..728dfe8ae 100644 --- a/testing/plugin/test_pytest_runner.py +++ b/testing/plugin/test_runner.py @@ -1,5 +1,5 @@ import py, sys -from pytest.plugin import pytest_runner as runner +from pytest.plugin import runner from py._code.code import ReprExceptionInfo class TestSetupState: diff --git a/testing/plugin/test_pytest_session.py b/testing/plugin/test_session.py similarity index 99% rename from testing/plugin/test_pytest_session.py rename to testing/plugin/test_session.py index 662e4f7a0..68899252f 100644 --- a/testing/plugin/test_pytest_session.py +++ b/testing/plugin/test_session.py @@ -1,5 +1,5 @@ import py -from pytest.plugin.pytest_session import pytest_report_iteminfo +from pytest.plugin.session import pytest_report_iteminfo class SessionTests: def test_basic_testitem_events(self, testdir): diff --git a/testing/plugin/test_pytest_skipping.py b/testing/plugin/test_skipping.py similarity index 98% rename from testing/plugin/test_pytest_skipping.py rename to testing/plugin/test_skipping.py index 38cb40f72..33c16bb46 100644 --- a/testing/plugin/test_pytest_skipping.py +++ b/testing/plugin/test_skipping.py @@ -1,8 +1,8 @@ import py -from pytest.plugin.pytest_skipping import MarkEvaluator -from pytest.plugin.pytest_skipping import pytest_runtest_setup -from pytest.plugin.pytest_runner import runtestprotocol +from pytest.plugin.skipping import MarkEvaluator, folded_skips +from pytest.plugin.skipping import pytest_runtest_setup +from pytest.plugin.runner import runtestprotocol class TestEvaluator: def test_no_marker(self, testdir): @@ -366,7 +366,6 @@ def test_skipif_class(testdir): def test_skip_reasons_folding(): - from pytest.plugin.pytest_skipping import folded_skips class longrepr: class reprcrash: path = 'xyz' diff --git a/testing/plugin/test_pytest_terminal.py b/testing/plugin/test_terminal.py similarity index 99% rename from testing/plugin/test_pytest_terminal.py rename to testing/plugin/test_terminal.py index 33bcdd26d..3940fb54c 100644 --- a/testing/plugin/test_pytest_terminal.py +++ b/testing/plugin/test_terminal.py @@ -9,9 +9,9 @@ import sys # # =============================================================================== -from pytest.plugin.pytest_terminal import TerminalReporter, \ +from pytest.plugin.terminal import TerminalReporter, \ CollectonlyReporter, repr_pythonversion, getreportopt -from pytest.plugin import pytest_runner as runner +from pytest.plugin import runner def basic_run_report(item): runner.call_and_report(item, "setup", log=False) diff --git a/testing/plugin/test_pytest_tmpdir.py b/testing/plugin/test_tmpdir.py similarity index 79% rename from testing/plugin/test_pytest_tmpdir.py rename to testing/plugin/test_tmpdir.py index 0f676ec67..a15ec7e12 100644 --- a/testing/plugin/test_pytest_tmpdir.py +++ b/testing/plugin/test_tmpdir.py @@ -1,7 +1,7 @@ import py -from pytest.plugin.pytest_tmpdir import pytest_funcarg__tmpdir -from pytest.plugin.pytest_python import FuncargRequest +from pytest.plugin.tmpdir import pytest_funcarg__tmpdir +from pytest.plugin.python import FuncargRequest def test_funcarg(testdir): item = testdir.getitem("def test_func(tmpdir): pass") diff --git a/testing/plugin/test_pytest_unittest.py b/testing/plugin/test_unittest.py similarity index 100% rename from testing/plugin/test_pytest_unittest.py rename to testing/plugin/test_unittest.py diff --git a/testing/test_collection.py b/testing/test_collection.py index 4eaf7718b..231617993 100644 --- a/testing/test_collection.py +++ b/testing/test_collection.py @@ -1,6 +1,6 @@ import py -from pytest.plugin.pytest_session import Collection, gettopdir +from pytest.plugin.session import Collection, gettopdir class TestCollection: def test_parsearg(self, testdir):