From a15983cb33605eb2efe4024d0f5b0d744358afbe Mon Sep 17 00:00:00 2001 From: holger krekel Date: Tue, 7 Dec 2010 12:34:18 +0100 Subject: [PATCH] rather named the new hook cmdline_preparse --- _pytest/config.py | 2 +- _pytest/hookspec.py | 2 +- doc/example/simple.txt | 2 +- doc/plugins.txt | 2 +- pytest.py | 2 +- setup.py | 2 +- testing/test_config.py | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/_pytest/config.py b/_pytest/config.py index d5899368f..65b6d4100 100644 --- a/_pytest/config.py +++ b/_pytest/config.py @@ -306,7 +306,7 @@ class Config(object): self._setinitialconftest(args) self.pluginmanager.do_addoption(self._parser) if addopts: - self.hook.pytest_cmdline_processargs(config=self, args=args) + self.hook.pytest_cmdline_preparse(config=self, args=args) def _checkversion(self): minver = self.inicfg.get('minversion', None) diff --git a/_pytest/hookspec.py b/_pytest/hookspec.py index 23d3137b5..580ab2799 100644 --- a/_pytest/hookspec.py +++ b/_pytest/hookspec.py @@ -19,7 +19,7 @@ def pytest_cmdline_parse(pluginmanager, args): """return initialized config object, parsing the specified args. """ pytest_cmdline_parse.firstresult = True -def pytest_cmdline_processargs(config, args): +def pytest_cmdline_preparse(config, args): """modify command line arguments before option parsing. """ def pytest_addoption(parser): diff --git a/doc/example/simple.txt b/doc/example/simple.txt index 23f89bf59..ffdf625af 100644 --- a/doc/example/simple.txt +++ b/doc/example/simple.txt @@ -154,7 +154,7 @@ the command line arguments before they get processed:: # content of conftest.py import sys - def pytest_cmdline_processargs(args): + def pytest_cmdline_preparse(args): if 'xdist' in sys.modules: # pytest-xdist plugin import multiprocessing num = max(multiprocessing.cpu_count() / 2, 1) diff --git a/doc/plugins.txt b/doc/plugins.txt index 2c640c178..8ea6f0d00 100644 --- a/doc/plugins.txt +++ b/doc/plugins.txt @@ -271,7 +271,7 @@ initialisation, command line and configuration hooks .. currentmodule:: _pytest.hookspec -.. autofunction:: pytest_cmdline_processargs +.. autofunction:: pytest_cmdline_preparse .. autofunction:: pytest_cmdline_parse .. autofunction:: pytest_namespace .. autofunction:: pytest_addoption diff --git a/pytest.py b/pytest.py index af6332778..68d2fb50b 100644 --- a/pytest.py +++ b/pytest.py @@ -1,7 +1,7 @@ """ unit and functional testing with Python. """ -__version__ = '2.0.1.dev4' +__version__ = '2.0.1.dev5' __all__ = ['main'] from _pytest.core import main, UsageError, _preloadplugins diff --git a/setup.py b/setup.py index 67767b7a8..d1a459315 100644 --- a/setup.py +++ b/setup.py @@ -22,7 +22,7 @@ def main(): name='pytest', description='py.test: simple powerful testing with Python', long_description = long_description, - version='2.0.1.dev4', + version='2.0.1.dev5', url='http://pytest.org', license='MIT license', platforms=['unix', 'linux', 'osx', 'cygwin', 'win32'], diff --git a/testing/test_config.py b/testing/test_config.py index b2ee0f190..130ff2aa6 100644 --- a/testing/test_config.py +++ b/testing/test_config.py @@ -261,7 +261,7 @@ def test_plugin_preparse_prevents_setuptools_loading(testdir, monkeypatch): def test_cmdline_processargs_simple(testdir): testdir.makeconftest(""" - def pytest_cmdline_processargs(args): + def pytest_cmdline_preparse(args): args.append("-h") """) result = testdir.runpytest()