Skip to content

MAINT: clean-up unused objects #254

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
Apr 13, 2020
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
2 changes: 1 addition & 1 deletion doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@
html_theme = 'scipy'
html_theme_path = [themedir]

if 'scipyorg' in tags:
if 'scipyorg' in tags: # noqa: F821
# Build for the scipy.org website
html_theme_options = {
"edit_link": True,
Expand Down
1 change: 0 additions & 1 deletion numpydoc/docscrape.py
Original file line number Diff line number Diff line change
Expand Up @@ -595,7 +595,6 @@ def __str__(self):
out = ''

func, func_name = self.get_func()
signature = self['Signature'].replace('*', r'\*')

roles = {'func': 'function',
'meth': 'method'}
Expand Down
23 changes: 1 addition & 22 deletions numpydoc/tests/test_docscrape.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
from collections import namedtuple
from copy import deepcopy
import re
import sys
import textwrap
import warnings

Expand Down Expand Up @@ -264,26 +263,6 @@ def test_returnyield():
assert_raises(ValueError, NumpyDocString, doc_text)


def test_returnyield():
doc_text = """
Test having returns and yields.

Returns
-------
int
The number of apples.

Yields
------
a : int
The number of apples.
b : int
The number of bananas.

"""
assert_raises(ValueError, NumpyDocString, doc_text)


def test_section_twice():
doc_text = """
Test having a section Notes twice
Expand Down Expand Up @@ -859,7 +838,7 @@ class Dummy(object):
def test_see_also_trailing_comma_warning():
warnings.filterwarnings('error')
with assert_warns(Warning, match='Unexpected comma or period after function list at index 43 of line .*'):
doc6 = NumpyDocString(
NumpyDocString(
"""
z(x,theta)

Expand Down
13 changes: 8 additions & 5 deletions numpydoc/tests/test_numpydoc.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,25 +42,28 @@ def test_mangle_docstrings():
.. autoclass:: str
'''
lines = s.split('\n')
doc = mangle_docstrings(MockApp(), 'class', 'str', str, {}, lines)
mangle_docstrings(MockApp(), 'class', 'str', str, {}, lines)
assert 'rpartition' in [x.strip() for x in lines]

lines = s.split('\n')
doc = mangle_docstrings(MockApp(), 'class', 'str', str, {'members': ['upper']}, lines)
mangle_docstrings(
MockApp(), 'class', 'str', str, {'members': ['upper']}, lines)
assert 'rpartition' not in [x.strip() for x in lines]
assert 'upper' in [x.strip() for x in lines]

lines = s.split('\n')
doc = mangle_docstrings(MockApp(), 'class', 'str', str, {'exclude-members': ALL}, lines)
mangle_docstrings(
MockApp(), 'class', 'str', str, {'exclude-members': ALL}, lines)
assert 'rpartition' not in [x.strip() for x in lines]
assert 'upper' not in [x.strip() for x in lines]

lines = s.split('\n')
doc = mangle_docstrings(MockApp(), 'class', 'str', str,
{'exclude-members': ['upper']}, lines)
mangle_docstrings(
MockApp(), 'class', 'str', str, {'exclude-members': ['upper']}, lines)
assert 'rpartition' in [x.strip() for x in lines]
assert 'upper' not in [x.strip() for x in lines]


if __name__ == "__main__":
import pytest
pytest.main()