Skip to content

TST: skip gbq test again / fix parsers/test_network url #15407

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

Closed
wants to merge 3 commits into from

Conversation

jreback
Copy link
Contributor

@jreback jreback commented Feb 15, 2017

No description provided.

@jreback jreback added IO Google Testing pandas testing functions or related to the test suite labels Feb 15, 2017
@jreback jreback added this to the 0.20.0 milestone Feb 15, 2017
@@ -15,42 +15,32 @@
from pandas.io.parsers import read_csv, read_table


class TestCompressedUrl(object):
@pytest.fixture
def salaries_table(scope='module'):
Copy link
Contributor

Choose a reason for hiding this comment

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

scope goes on the decorator, not the function.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

thanks, that was a typo!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

odd linter didn't even catch that

@@ -17,5 +17,5 @@ def pytest_runtest_setup(item):
if 'slow' not in item.keywords and item.config.getoption("--only-slow"):
pytest.skip("skipping due to --only-slow")

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@pytest.mark.parametrize(
"compression,extension", [('gzip', '.gz'), ('bz2', '.bz2'),
('zip', '.zip'), ('xz', '.xz')])
def test_compressed_urls(salaries_table, compression, extension):
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@TomAugspurger I had to do this in an odd way (meaning having the parameterized fixed call another function)

as the @tm.network decorator doesn't play nice in python 2 ONLY. It works in python 3 though.

any idea?

Copy link
Contributor

Choose a reason for hiding this comment

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

IIRC, decorators need to fully copy the whole argument signature. This is not too bad on Python 3.4+ because functools.wraps does it already, but it's a bit of a pain on 2.7. The easiest is to use the decorator package, though on matplotlib, I just replaced the decorators like that with an automatic fixture and some markers.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@QuLogic thanks for the expl.

yeah I think we need to fix tm.network and just make it a marker.. Though if you have suggestions pls speak up! (or just do a PR!).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

so you just use decorator.decorator instead of functools.wraps?

if its only for testing purposes, then we could easily do that (though even easier would be to fix our tm.network ....)

Copy link
Contributor

Choose a reason for hiding this comment

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

The syntax of decorator.decorator is a bit different; it replaces the outer function portion and you only need the wrapper bit, but I didn't pursue it much further.

@jreback jreback closed this in 03bb900 Feb 15, 2017
AnkurDedania pushed a commit to AnkurDedania/pandas that referenced this pull request Mar 21, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Testing pandas testing functions or related to the test suite
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants