Skip to content

Commit f5bc0ba

Browse files
committed
Added wraps to compat for Py27 testing
1 parent d471174 commit f5bc0ba

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

pandas/compat/__init__.py

+12
Original file line numberDiff line numberDiff line change
@@ -365,6 +365,18 @@ def callable(obj):
365365
return any("__call__" in klass.__dict__ for klass in type(obj).__mro__)
366366

367367

368+
if sys.version_info[0:2] < (3, 4):
369+
def wraps(wrapped, assigned=functools.WRAPPER_ASSIGNMENTS,
370+
updated=functools.WRAPPER_UPDATES):
371+
def wrapper(f):
372+
f = functools.wraps(wrapped, assigned, updated)(f)
373+
f.__wrapped__ = wrapped
374+
return f
375+
return wrapper
376+
else:
377+
wraps = functools.wraps
378+
379+
368380
def add_metaclass(metaclass):
369381
"""Class decorator for creating a class with a metaclass."""
370382
def wrapper(cls):

pandas/util/testing.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -2165,7 +2165,7 @@ def network(t, url="http://www.google.com",
21652165
from pytest import skip
21662166
t.network = True
21672167

2168-
@wraps(t)
2168+
@compat.wraps(t)
21692169
def wrapper(*args, **kwargs):
21702170
if check_before_test and not raise_on_error:
21712171
if not can_connect(url, error_classes):

0 commit comments

Comments
 (0)