diff --git a/doc/source/release.rst b/doc/source/release.rst index 37550f7ff5fb0..651c995e3e7bb 100644 --- a/doc/source/release.rst +++ b/doc/source/release.rst @@ -62,6 +62,8 @@ pandas 0.13 - Fixed an issue where ``DataFrame.sum`` was slower than ``DataFrame.mean`` for integer valued frames (:issue:`4365`) - ``read_html`` tests now work with Python 2.6 (:issue:`4351`) + - Fixed bug where ``network`` testing was throwing ``NameError`` because a + local variable was undefined (:issue:`4381`) pandas 0.12 =========== diff --git a/doc/source/v0.13.0.txt b/doc/source/v0.13.0.txt index 148c2389ccdc7..72a175fd25d58 100644 --- a/doc/source/v0.13.0.txt +++ b/doc/source/v0.13.0.txt @@ -43,6 +43,9 @@ Bug Fixes - ``read_html`` tests now work with Python 2.6 (:issue:`4351`) + - Fixed bug where ``network`` testing was throwing ``NameError`` because a + local variable was undefined (:issue:`4381`) + See the :ref:`full release notes ` or issue tracker on GitHub for a complete list. diff --git a/pandas/util/testing.py b/pandas/util/testing.py index d900c86ed11f9..7b2960ef498e1 100644 --- a/pandas/util/testing.py +++ b/pandas/util/testing.py @@ -12,7 +12,7 @@ from datetime import datetime from functools import wraps -from contextlib import contextmanager, closing +from contextlib import contextmanager from httplib import HTTPException from urllib2 import urlopen from distutils.version import LooseVersion @@ -31,8 +31,6 @@ from pandas.tseries.index import DatetimeIndex from pandas.tseries.period import PeriodIndex -from pandas.io.common import urlopen - Index = index.Index MultiIndex = index.MultiIndex Series = series.Series @@ -767,6 +765,8 @@ def network_wrapper(*args, **kwargs): if raise_on_error: return t(*args, **kwargs) else: + runs = 0 + for _ in range(num_runs): try: try: @@ -781,6 +781,8 @@ def network_wrapper(*args, **kwargs): else: raise + runs += 1 + return network_wrapper