rather named the new hook cmdline_preparse

This commit is contained in:
holger krekel 2010-12-07 12:34:18 +01:00
parent 9ab256c296
commit a15983cb33
7 changed files with 7 additions and 7 deletions

View File

@ -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)

View File

@ -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):

View File

@ -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)

View File

@ -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

View File

@ -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

View File

@ -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'],

View File

@ -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()