Skip to content

Conversation

@SaturnFromTitan
Copy link
Contributor

invgrep -R --include="*.py*" -E "from pandas._testing import" pandas/tests
RET=$(($RET + $?)) ; echo $MSG "DONE"
invgrep -R --include="*.py*" -E "from pandas.util import testing as tm" pandas/tests
invgrep -R --include="*.py*" -E "from pandas import _testing as tm" pandas/tests
Copy link
Contributor Author

@SaturnFromTitan SaturnFromTitan Apr 20, 2020

Choose a reason for hiding this comment

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

I just converted this from util.testing to ._testing. Seems like this code check wasn't adapted to the new location of the testing module.

It's not related, but as the PR is tiny otherwise, I think it's ok to include it.

RET=$(($RET + $?)) ; echo $MSG "DONE"

# No direct imports from conftest
invgrep -R --include="*.py*" -E "conftest import" pandas/tests
Copy link
Contributor Author

@SaturnFromTitan SaturnFromTitan Apr 20, 2020

Choose a reason for hiding this comment

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

using "conftest import" instead of "pandas.conftest import" to make it work for all conftest files

@SaturnFromTitan SaturnFromTitan changed the title added CI checks to avoid direct imports from conftest TST: added CI checks to avoid direct imports from conftest Apr 20, 2020
@SaturnFromTitan SaturnFromTitan added the Testing pandas testing functions or related to the test suite label Apr 20, 2020
@SaturnFromTitan SaturnFromTitan requested a review from jreback April 20, 2020 01:08
@SaturnFromTitan SaturnFromTitan changed the title TST: added CI checks to avoid direct imports from conftest TST: CI checks against direct imports from conftest.py Apr 20, 2020
@simonjayhawkins simonjayhawkins added this to the 1.1 milestone Apr 20, 2020
Copy link
Member

@simonjayhawkins simonjayhawkins left a comment

Choose a reason for hiding this comment

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

Thanks @SaturnFromTitan lgtm.

@simonjayhawkins simonjayhawkins added the Code Style Code style, linting, code_checks label Apr 20, 2020
@jreback jreback merged commit 7afb870 into pandas-dev:master Apr 20, 2020
@jreback
Copy link
Contributor

jreback commented Apr 20, 2020

thanks @SaturnFromTitan

rhshadrach pushed a commit to rhshadrach/pandas that referenced this pull request May 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Code Style Code style, linting, code_checks Testing pandas testing functions or related to the test suite

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make a code check which bans imports of fixtures in tests

3 participants