diff --git a/doc/conf.py b/doc/conf.py index 568b8004..e9197631 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -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, diff --git a/numpydoc/docscrape.py b/numpydoc/docscrape.py index affbb03e..48daf0d8 100644 --- a/numpydoc/docscrape.py +++ b/numpydoc/docscrape.py @@ -595,7 +595,6 @@ def __str__(self): out = '' func, func_name = self.get_func() - signature = self['Signature'].replace('*', r'\*') roles = {'func': 'function', 'meth': 'method'} diff --git a/numpydoc/tests/test_docscrape.py b/numpydoc/tests/test_docscrape.py index a14f0649..4eace943 100644 --- a/numpydoc/tests/test_docscrape.py +++ b/numpydoc/tests/test_docscrape.py @@ -2,7 +2,6 @@ from collections import namedtuple from copy import deepcopy import re -import sys import textwrap import warnings @@ -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 @@ -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) diff --git a/numpydoc/tests/test_numpydoc.py b/numpydoc/tests/test_numpydoc.py index e4508df2..383ca189 100644 --- a/numpydoc/tests/test_numpydoc.py +++ b/numpydoc/tests/test_numpydoc.py @@ -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()