Merge remote-tracking branch 'upstream/master'

This commit is contained in:
Alexander Cogneau 2015-08-04 16:32:31 +02:00
commit 3fa99abca8
2 changed files with 13 additions and 16 deletions

View File

@ -22,7 +22,6 @@
import io
import sys
import enum
import inspect
import os.path
import collections
import functools
@ -548,20 +547,18 @@ def qualname(obj):
"""
if isinstance(obj, functools.partial):
obj = obj.func
if hasattr(obj, '__qualname__'):
name = obj.__qualname__
elif hasattr(obj, '__name__'):
name = obj.__name__
else:
name = repr(obj)
if inspect.isclass(obj) or inspect.isfunction(obj):
module = obj.__module__
return "{}.{}".format(module, name)
elif inspect.ismethod(obj):
return "{}.{}".format(obj.__module__, name)
if hasattr(obj, '__module__'):
prefix = '{}.'.format(obj.__module__)
else:
return name
prefix = ''
if hasattr(obj, '__qualname__'):
return '{}{}'.format(prefix, obj.__qualname__)
elif hasattr(obj, '__name__'):
return '{}{}'.format(prefix, obj.__name__)
else:
return repr(obj)
def raises(exc, func, *args):

View File

@ -27,8 +27,8 @@ deps =
pytest-qt==1.5.1
pytest-mock==0.7.0
pytest-html==1.3.2
hypothesis==1.10.0
hypothesis-pytest==0.15.0
hypothesis==1.10.1
hypothesis-pytest==0.15.1
commands =
{envpython} scripts/link_pyqt.py --tox {envdir}
{envpython} -m py.test --strict -rfEsw {posargs:tests}
@ -82,7 +82,7 @@ deps =
astroid==1.3.8
beautifulsoup4==4.4.0
pylint==1.4.4
hypothesis==1.10.0
hypothesis==1.10.1
logilab-common==1.0.2
six==1.9.0
commands =