[Pytest-commit] commit/pytest: hpk42: fix python2.5 issues
commits-noreply at bitbucket.org
commits-noreply at bitbucket.org
Thu Oct 3 18:30:06 CEST 2013
1 new commit in pytest:
https://bitbucket.org/hpk42/pytest/commits/009eb952c0d1/
Changeset: 009eb952c0d1
User: hpk42
Date: 2013-10-03 18:25:03
Summary: fix python2.5 issues
Affected #: 2 files
diff -r d5a0e8a77e0f2ccfea495c44a80b5a1409a0e832 -r 009eb952c0d159faddf41113f4b211bd11b8aa3b _pytest/monkeypatch.py
--- a/_pytest/monkeypatch.py
+++ b/_pytest/monkeypatch.py
@@ -1,7 +1,6 @@
""" monkeypatching and mocking functionality. """
-import os, sys, inspect
-import pytest
+import os, sys
def pytest_funcarg__monkeypatch(request):
"""The returned ``monkeypatch`` funcarg provides these
@@ -28,6 +27,7 @@
def derive_importpath(import_path):
+ import pytest
if not isinstance(import_path, str) or "." not in import_path:
raise TypeError("must be absolute import path string, not %r" %
(import_path,))
@@ -82,6 +82,7 @@
which means it will raise).
"""
__tracebackhide__ = True
+ import inspect
if value is notset:
if not isinstance(target, str):
diff -r d5a0e8a77e0f2ccfea495c44a80b5a1409a0e832 -r 009eb952c0d159faddf41113f4b211bd11b8aa3b _pytest/terminal.py
--- a/_pytest/terminal.py
+++ b/_pytest/terminal.py
@@ -37,11 +37,11 @@
# we try hard to make printing resilient against
# later changes on FD level. (unless capturing is off/sys)
stdout = sys.stdout
- if hasattr(os, "dup"):
+ if hasattr(os, "dup") and hasattr(stdout, "fileno"):
try:
newstdout = py.io.dupfile(stdout, buffering=1,
encoding=stdout.encoding)
- except ValueError:
+ except (AttributeError, ValueError):
pass
else:
assert stdout.encoding == newstdout.encoding
Repository URL: https://bitbucket.org/hpk42/pytest/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
More information about the pytest-commit
mailing list