Skip to content

TST/BUG: fix NameError in network decorator #4381

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 27, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions doc/source/release.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
===========
Expand Down
3 changes: 3 additions & 0 deletions doc/source/v0.13.0.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
<release>` or issue tracker
on GitHub for a complete list.
8 changes: 5 additions & 3 deletions pandas/util/testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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:
Expand All @@ -781,6 +781,8 @@ def network_wrapper(*args, **kwargs):
else:
raise

runs += 1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

whoops...thanks for catching this!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no problem. just setting up an ubuntu server at home (so i can run vbench while doing other things) and a read_html test failed


return network_wrapper


Expand Down