Skip to content

Commit

Permalink
Improve error message, fix partial scope
Browse files Browse the repository at this point in the history
  • Loading branch information
dhimmel committed Dec 12, 2016
1 parent 9977da2 commit c2e6e5b
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions pandas/io/tests/parser/test_network.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,17 @@ def __init__(self):

def test_compressed_urls(self):
"""Test reading compressed tables from URL."""
# test_fxn is a workaround for more descriptive nose reporting.
# See http://stackoverflow.com/a/37393684/4651668.
test_fxn = functools.partial(self.check_table)

msg = ('Test reading {}-compressed tables from URL: '
'compression="{}", engine="{}"')

for compression, extension in self.compression_to_extension.items():
url = self.base_url + extension
# args is a (compression, engine) tuple
for args in [(compression, 'python'), ('infer', 'python')]:
test_fxn.description = '{} compression, {} engine'.format(*args)
# test_fxn is a workaround for more descriptive nose reporting.
# See http://stackoverflow.com/a/37393684/4651668.
test_fxn = functools.partial(self.check_table)
test_fxn.description = msg.format(compression, *args)
yield (test_fxn, url) + args

def check_table(self, url, compression, engine):
Expand Down

0 comments on commit c2e6e5b

Please sign in to comment.