8000 Move inconsistent namespace check to pre-commit, fixup more files by MarcoGorelli · Pull Request #37662 · pandas-dev/pandas · GitHub
[go: up one dir, main page]

Skip to content

Move inconsistent namespace check to pre-commit, fixup more files #37662

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 17 commits into from
Nov 8, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
🚚 rename
  • Loading branch information
MarcoGorelli committed Nov 6, 2020
commit 01bf754d62219dca40563f4243834e5b17b1aafe
12 changes: 6 additions & 6 deletions scripts/tests/test_inconsistent_namespace_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@

import pytest

FILE_0 = "cat_0 = Categorical()\ncat_1 = pd.Categorical()"
FILE_1 = "cat_0 = pd.Categorical()\ncat_1 = Categorical()"
FILE_2 = "cat_0 = Categorical()\ncat_1 = Categorical()"
FILE_3 = "cat_0 = pd.Categorical()\ncat_1 = pd.Categorical()"
BAD_FILE_0 = "cat_0 = Categorical()\ncat_1 = pd.Categorical()"
BAD_FILE_1 = "cat_0 = pd.Categorical()\ncat_1 = Categorical()"
GOOD_FILE_0 = "cat_0 = Categorical()\ncat_1 = Categorical()"
GOOD_FILE_1 = "cat_0 = pd.Categorical()\ncat_1 = pd.Categorical()"


@pytest.mark.parametrize("content", [FILE_0, FILE_1])
@pytest.mark.parametrize("content", [BAD_FILE_0, BAD_FILE_1])
def test_inconsistent_usage(tmpdir, content: str) -> None:
tmpfile = Path(tmpdir / "tmpfile.py")
tmpfile.touch()
Expand All @@ -30,7 +30,7 @@ def test_inconsistent_usage(tmpdir, content: str) -> None:
assert result == expected


@pytest.mark.parametrize("content", [FILE_2, FILE_3])
@pytest.mark.parametrize("content", [GOOD_FILE_0, GOOD_FILE_1])
def test_consistent_usage(tmpdir, content: str) -> None:
tmpfile = Path(tmpdir / "tmpfile.py")
tmpfile.touch()
Expand Down
0