Skip to content

DOC: Fix encoding of docstring validation for Windows #25466

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 15 commits into from
May 7, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
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
8 changes: 8 additions & 0 deletions scripts/tests/test_validate_docstrings.py
Original file line number Diff line number Diff line change
Expand Up @@ -1052,6 +1052,14 @@ def test_raises_for_invalid_attribute_name(self, invalid_name):
with pytest.raises(AttributeError, match=msg):
validate_docstrings.Docstring(invalid_name)

@pytest.mark.parametrize('name', ['pandas.Series.str.isdecimal',
'pandas.Series.str.islower'])
def test_encode_content_write_to_file(self, name):
# GH25466
docstr = validate_docstrings.Docstring(name).validate_pep8()
# the list of pep8 errors should be empty
assert not list(docstr)


class TestMainFunction:
def test_exit_status_for_validate_one(self, monkeypatch):
Expand Down
2 changes: 1 addition & 1 deletion scripts/validate_docstrings.py
Original file line number Diff line number Diff line change
Expand Up @@ -583,7 +583,7 @@ def validate_pep8(self):
application = flake8.main.application.Application()
application.initialize(["--quiet"])

with tempfile.NamedTemporaryFile(mode='w') as file:
with tempfile.NamedTemporaryFile(mode='w', encoding='utf-8') as file:
file.write(content)
file.flush()
application.run_checks([file.name])
Expand Down