Author: Amaury Forgeot d'Arc <[email protected]>
Branch: py3k
Changeset: r58760:c63145cd4fa5
Date: 2012-11-05 22:48 +0100
http://bitbucket.org/pypy/pypy/changeset/c63145cd4fa5/
Log: conftest.py is now importable by python3!
diff --git a/pypy/conftest.py b/pypy/conftest.py
--- a/pypy/conftest.py
+++ b/pypy/conftest.py
@@ -30,8 +30,9 @@
def pytest_addhooks(pluginmanager):
- from pypy.tool.pytest.plugins import LeakFinder
- pluginmanager.register(LeakFinder())
+ if sys.version_info < (3,):
+ from pypy.tool.pytest.plugins import LeakFinder
+ pluginmanager.register(LeakFinder())
def pytest_configure(config):
@@ -93,10 +94,13 @@
apparently earlier on "raises" was already added
to module's globals.
"""
- import __builtin__
+ try:
+ import builtins
+ except ImportError:
+ import __builtin__ as builtins
for helper in helpers:
- if not hasattr(__builtin__, helper):
- setattr(__builtin__, helper, getattr(py.test, helper))
+ if not hasattr(builtins, helper):
+ setattr(builtins, helper, getattr(py.test, helper))
def pytest_sessionstart(session):
""" before session.main() is called. """
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit