mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-06 12:20:52 +01:00
improve test_docs_coverage error messages (#21029)
Summary: Most important fix: Correct "tensor.rst" to "tensors.rst" Secondary fix: some minor English spelling/grammar fixes. Pull Request resolved: https://github.com/pytorch/pytorch/pull/21029 Differential Revision: D15523230 Pulled By: umanwizard fbshipit-source-id: 6052d8609c86efa41a4289cd3a099b2f1037c810
This commit is contained in:
parent
e13b483f58
commit
8c927b208c
|
|
@ -60,16 +60,16 @@ class TestDocCoverage(unittest.TestCase):
|
||||||
has_docstring & whitelist, whitelist,
|
has_docstring & whitelist, whitelist,
|
||||||
textwrap.dedent('''
|
textwrap.dedent('''
|
||||||
The whitelist in test_docs_coverage.py contains something
|
The whitelist in test_docs_coverage.py contains something
|
||||||
that don't have docstring or not in torch.*. If you just
|
that doesn't have a docstring or isn't in torch.*. If you just
|
||||||
removed something from torch.*, please remove it from whiltelist
|
removed something from torch.*, please remove it from the whitelist
|
||||||
in test_docs_coverage.py'''))
|
in test_docs_coverage.py'''))
|
||||||
has_docstring -= whitelist
|
has_docstring -= whitelist
|
||||||
# assert they are equal
|
# assert they are equal
|
||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
has_docstring, in_rst,
|
has_docstring, in_rst,
|
||||||
textwrap.dedent('''
|
textwrap.dedent('''
|
||||||
List of functions documented in torch.rst and in python are different.
|
The lists of functions documented in torch.rst and in python are different.
|
||||||
Do you forget to add new thing to torch.rst, or whitelist things you
|
Did you forget to add a new thing to torch.rst, or whitelist things you
|
||||||
don't want to document?''')
|
don't want to document?''')
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -80,8 +80,8 @@ class TestDocCoverage(unittest.TestCase):
|
||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
has_docstring, in_rst,
|
has_docstring, in_rst,
|
||||||
textwrap.dedent('''
|
textwrap.dedent('''
|
||||||
List of tensor methods documented in tensor.rst and in python are
|
The lists of tensor methods documented in tensors.rst and in python are
|
||||||
different. Do you forget to add new thing to tensor.rst, or whitelist
|
different. Did you forget to add a new thing to tensors.rst, or whitelist
|
||||||
things you don't want to document?''')
|
things you don't want to document?''')
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user