Skip to content

TST: Move tests/scripts to scripts/tests #22531

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 1 commit into from
Sep 1, 2018

Conversation

gfyoung
Copy link
Member

@gfyoung gfyoung commented Aug 29, 2018

Moves the tests/scripts directory to scripts/tests, as these tests don't really belong in the top-level pandas directory (they test the scripts directory, not pandas).

@gfyoung gfyoung added Refactor Internal refactoring of code Testing pandas testing functions or related to the test suite labels Aug 29, 2018
@gfyoung gfyoung added this to the 0.24.0 milestone Aug 29, 2018
@gfyoung gfyoung force-pushed the scripts-own-tests branch from 412fbd9 to 3f10e75 Compare August 29, 2018 03:34
@codecov
Copy link

codecov bot commented Aug 29, 2018

Codecov Report

Merging #22531 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master   #22531   +/-   ##
=======================================
  Coverage   92.04%   92.04%           
=======================================
  Files         169      169           
  Lines       50787    50787           
=======================================
  Hits        46745    46745           
  Misses       4042     4042
Flag Coverage Δ
#multiple 90.45% <ø> (ø) ⬆️
#single 42.29% <ø> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 98fb53c...868f6bf. Read the comment docs.

@gfyoung gfyoung force-pushed the scripts-own-tests branch 2 times, most recently from f75d9bb to 01bf8e5 Compare August 29, 2018 05:05
@gfyoung gfyoung changed the title WIP: Move tests/scripts to scripts/tests TST: Move tests/scripts to scripts/tests Aug 29, 2018
@gfyoung
Copy link
Member Author

gfyoung commented Aug 29, 2018

Copy link
Member

@datapythonista datapythonista left a comment

Choose a reason for hiding this comment

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

Good changes, I think they make things simpler and better organized. Thanks!

import pytest
import string
import random
Copy link
Member

Choose a reason for hiding this comment

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

standard library imports should go before third-party module imports

https://www.python.org/dev/peps/pep-0008/#imports

Copy link
Member Author

Choose a reason for hiding this comment

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

Indeed, they should! Done.

import random
import numpy as np

validate_docstrings = pytest.importorskip("validate_docstrings")
Copy link
Member

Choose a reason for hiding this comment

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

I guess I'm missing something obvious, but why is this needed? can't we simply import validate_docstrings?

Copy link
Member Author

Choose a reason for hiding this comment

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

That's vestigial paranoia from when we skipped tests if we couldn't see validate_docstrings. I agree that we can just import this without the protection.

for i in range(length))
length = random.randint(1, 10)
letters = "".join(random.choice(string.ascii_lowercase)
for _ in range(length))
Copy link
Member

Choose a reason for hiding this comment

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

I know this comes from the original code, but we don't need a comprehension here, we can simply do ''.join(random.sample(string.ascii_lowercase, length))

Copy link
Member Author

Choose a reason for hiding this comment

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

Fair enough. Done.

.travis.yml Outdated
@@ -57,6 +57,9 @@ matrix:
- dist: trusty
env:
- JOB="3.6, coverage" ENV_FILE="ci/travis-36.yaml" TEST_ARGS="--skip-slow --skip-network" PANDAS_TESTING_MODE="deprecate" COVERAGE=true DOCTEST=true
- dist: trusty
Copy link
Contributor

Choose a reason for hiding this comment

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

i don't think we need another build

Copy link
Contributor

Choose a reason for hiding this comment

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

you can just put on an existing build

Copy link
Member Author

Choose a reason for hiding this comment

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

That's fair, and I agree we can do that. I don't have access to my computer ATM (which is why I haven't addressed the comments).

@@ -0,0 +1,3 @@
def pytest_addoption(parser):
Copy link
Contributor

Choose a reason for hiding this comment

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

what is this for?

Copy link
Member Author

@gfyoung gfyoung Aug 31, 2018

Choose a reason for hiding this comment

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

As it says in the code: it's needed to placate setup.cfg.

--strict-data-files is enabled across the board for all tests, so we need to "accommodate" that option here.

@WillAyd
Copy link
Member

WillAyd commented Aug 30, 2018

Think we also need to update the Makefile to ensure this still gets linted (?)

.travis.yml Outdated
@@ -57,6 +57,9 @@ matrix:
- dist: trusty
env:
- JOB="3.6, coverage" ENV_FILE="ci/travis-36.yaml" TEST_ARGS="--skip-slow --skip-network" PANDAS_TESTING_MODE="deprecate" COVERAGE=true DOCTEST=true
- dist: trusty
Copy link
Contributor

Choose a reason for hiding this comment

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

you can just put on an existing build

@gfyoung
Copy link
Member Author

gfyoung commented Sep 1, 2018

Think we also need to update the Makefile to ensure this still gets linted (?)

@WillAyd : AFAICT we don't use the Makefile when doing the linting on Travis. That being said, I don't see why we can't add it as another command.

@gfyoung
Copy link
Member Author

gfyoung commented Sep 1, 2018

@jreback @datapythonista @WillAyd :

I've addressed all of your comments, and everything is still green! PTAL.

@gfyoung
Copy link
Member Author

gfyoung commented Sep 1, 2018

@jreback : Is this good to merge since you approved it? (you generally have merged after approval)

@jreback
Copy link
Contributor

jreback commented Sep 1, 2018

yep

@gfyoung gfyoung merged commit 550a5ca into pandas-dev:master Sep 1, 2018
@gfyoung gfyoung deleted the scripts-own-tests branch September 1, 2018 21:57
Sup3rGeo pushed a commit to Sup3rGeo/pandas that referenced this pull request Oct 1, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Refactor Internal refactoring of code Testing pandas testing functions or related to the test suite
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants