Improve error message, fix partial scope · pandas-dev/pandas@c2e6e5b (original) (raw)

Original file line number Diff line number Diff line change
@@ -32,15 +32,17 @@ def __init__(self):
32 32
33 33 def test_compressed_urls(self):
34 34 """Test reading compressed tables from URL."""
35 -# test_fxn is a workaround for more descriptive nose reporting.
36 -# See http://stackoverflow.com/a/37393684/4651668.
37 -test_fxn = functools.partial(self.check_table)
38 -
35 +msg = ('Test reading {}-compressed tables from URL: '
36 +'compression="{}", engine="{}"')
37 +
39 38 for compression, extension in self.compression_to_extension.items():
40 39 url = self.base_url + extension
41 40 # args is a (compression, engine) tuple
42 41 for args in [(compression, 'python'), ('infer', 'python')]:
43 -test_fxn.description = '{} compression, {} engine'.format(*args)
42 +# test_fxn is a workaround for more descriptive nose reporting.
43 +# See http://stackoverflow.com/a/37393684/4651668.
44 +test_fxn = functools.partial(self.check_table)
45 +test_fxn.description = msg.format(compression, *args)
44 46 yield (test_fxn, url) + args
45 47
46 48 def check_table(self, url, compression, engine):