From c10fce142d5d19ba2d05e56483195cee591764e3 Mon Sep 17 00:00:00 2001 From: Phillip Cloud Date: Sat, 27 Jul 2013 16:19:27 -0400 Subject: [PATCH 1/3] TST/BUG: fix NameError in network decorator --- pandas/util/testing.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/pandas/util/testing.py b/pandas/util/testing.py index d900c86ed11f9..f28dfac257e93 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,7 +765,10 @@ def network_wrapper(*args, **kwargs): if raise_on_error: return t(*args, **kwargs) else: + runs = 0 + for _ in range(num_runs): + try: try: return t(*args, **kwargs) @@ -781,6 +782,8 @@ def network_wrapper(*args, **kwargs): else: raise + runs += 1 + return network_wrapper From 96db7366860f75fcfd4610579ea2bdc53dbc8be8 Mon Sep 17 00:00:00 2001 From: Phillip Cloud Date: Sat, 27 Jul 2013 16:20:45 -0400 Subject: [PATCH 2/3] DOC: release notes --- doc/source/release.rst | 2 ++ doc/source/v0.13.0.txt | 3 +++ 2 files changed, 5 insertions(+) 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. From 6bb024e26046701b61d3e9fd696beb2782214ca1 Mon Sep 17 00:00:00 2001 From: Phillip Cloud Date: Sat, 27 Jul 2013 16:27:07 -0400 Subject: [PATCH 3/3] CLN: remove some space --- pandas/util/testing.py | 1 - 1 file changed, 1 deletion(-) diff --git a/pandas/util/testing.py b/pandas/util/testing.py index f28dfac257e93..7b2960ef498e1 100644 --- a/pandas/util/testing.py +++ b/pandas/util/testing.py @@ -768,7 +768,6 @@ def network_wrapper(*args, **kwargs): runs = 0 for _ in range(num_runs): - try: try: return t(*args, **kwargs)