From d105e75d8714d6208d33a482053ed9020320cbdd Mon Sep 17 00:00:00 2001 From: holger krekel Date: Tue, 5 Jul 2011 18:01:31 +0200 Subject: [PATCH] fix pytest-xdist breakage --- _pytest/__init__.py | 2 +- _pytest/assertion/__init__.py | 5 ++++- setup.py | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/_pytest/__init__.py b/_pytest/__init__.py index 21687d318..052ff250a 100644 --- a/_pytest/__init__.py +++ b/_pytest/__init__.py @@ -1,2 +1,2 @@ # -__version__ = '2.1.0.dev6' +__version__ = '2.1.0.dev7' diff --git a/_pytest/assertion/__init__.py b/_pytest/assertion/__init__.py index 104f9a9ce..aedf7efe7 100644 --- a/_pytest/assertion/__init__.py +++ b/_pytest/assertion/__init__.py @@ -68,7 +68,10 @@ def pytest_unconfigure(config): if hook is not None: sys.meta_path.remove(hook) -def pytest_sessionstart(session): +def pytest_collection(session): + # this hook is only called when test modules are collected + # so for example not in the master process of pytest-xdist + # (which does not collect test modules) hook = session.config._assertstate.hook if hook is not None: hook.set_session(session) diff --git a/setup.py b/setup.py index ce9973248..f6b1cbb0b 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.1.0.dev6', + version='2.1.0.dev7', url='http://pytest.org', license='MIT license', platforms=['unix', 'linux', 'osx', 'cygwin', 'win32'],