From bf33b6e7961de71daddb7dc7adcea87a65f35fd2 Mon Sep 17 00:00:00 2001 From: Jacob Walls Date: Fri, 9 Aug 2024 08:26:14 -0400 Subject: [PATCH] [PY313] Use error that hasn't been renamed in docparams tests --- .../raise/missing_raises_doc_Google.py | 18 +++++++++--------- .../raise/missing_raises_doc_Google.txt | 2 +- .../raise/missing_raises_doc_Numpy.py | 18 +++++++++--------- .../raise/missing_raises_doc_Numpy.txt | 2 +- .../raise/missing_raises_doc_Sphinx.py | 18 +++++++++--------- .../raise/missing_raises_doc_Sphinx.txt | 2 +- 6 files changed, 30 insertions(+), 30 deletions(-) diff --git a/tests/functional/ext/docparams/raise/missing_raises_doc_Google.py b/tests/functional/ext/docparams/raise/missing_raises_doc_Google.py index 22dbcadaa3..f4ccea3133 100644 --- a/tests/functional/ext/docparams/raise/missing_raises_doc_Google.py +++ b/tests/functional/ext/docparams/raise/missing_raises_doc_Google.py @@ -17,33 +17,33 @@ def test_find_google_attr_raises_exact_exc(self): """This is a google docstring. Raises: - re.error: Sometimes + calendar.IllegalMonthError: Sometimes """ - import re + import calendar - raise re.error("hi") + raise calendar.IllegalMonthError(-1) def test_find_google_attr_raises_substr_exc(self): """This is a google docstring. Raises: - re.error: Sometimes + calendar.IllegalMonthError: Sometimes """ - from re import error + from calendar import IllegalMonthError - raise error("hi") + raise IllegalMonthError(-1) def test_find_valid_missing_google_attr_raises(self): # [missing-raises-doc] """This is a google docstring. Raises: - re.anothererror: Sometimes + calendar.anothererror: Sometimes """ - from re import error + from calendar import IllegalMonthError - raise error("hi") + raise IllegalMonthError(-1) def test_find_invalid_missing_google_attr_raises(self): diff --git a/tests/functional/ext/docparams/raise/missing_raises_doc_Google.txt b/tests/functional/ext/docparams/raise/missing_raises_doc_Google.txt index 5cd926a803..f3bbcad7fb 100644 --- a/tests/functional/ext/docparams/raise/missing_raises_doc_Google.txt +++ b/tests/functional/ext/docparams/raise/missing_raises_doc_Google.txt @@ -1,6 +1,6 @@ missing-raises-doc:6:0:6:35:test_find_missing_google_raises:"""RuntimeError"" not documented as being raised":HIGH unreachable:13:4:13:25:test_find_missing_google_raises:Unreachable code:HIGH -missing-raises-doc:38:0:38:46:test_find_valid_missing_google_attr_raises:"""PatternError"" not documented as being raised":HIGH +missing-raises-doc:38:0:38:46:test_find_valid_missing_google_attr_raises:"""IllegalMonthError"" not documented as being raised":HIGH unreachable:83:4:83:25:test_find_all_google_raises:Unreachable code:HIGH unreachable:94:4:94:25:test_find_multiple_google_raises:Unreachable code:HIGH unreachable:95:4:95:30:test_find_multiple_google_raises:Unreachable code:HIGH diff --git a/tests/functional/ext/docparams/raise/missing_raises_doc_Numpy.py b/tests/functional/ext/docparams/raise/missing_raises_doc_Numpy.py index 8cf8e041f1..44e047ceb3 100644 --- a/tests/functional/ext/docparams/raise/missing_raises_doc_Numpy.py +++ b/tests/functional/ext/docparams/raise/missing_raises_doc_Numpy.py @@ -87,12 +87,12 @@ def test_find_numpy_attr_raises_exact_exc(self): Raises ------ - re.error + calendar.IllegalMonthError Sometimes """ - import re + import calendar - raise re.error("hi") + raise calendar.IllegalMonthError(-1) def test_find_numpy_attr_raises_substr_exc(self): @@ -100,12 +100,12 @@ def test_find_numpy_attr_raises_substr_exc(self): Raises ------ - re.error + calendar.IllegalMonthError Sometimes """ - from re import error + from calendar import IllegalMonthError - raise error("hi") + raise IllegalMonthError(-1) def test_find_valid_missing_numpy_attr_raises(self): # [missing-raises-doc] @@ -113,12 +113,12 @@ def test_find_valid_missing_numpy_attr_raises(self): # [missing-raises-doc] Raises ------ - re.anothererror + calendar.anothererror Sometimes """ - from re import error + from calendar import IllegalMonthError - raise error("hi") + raise IllegalMonthError(-1) def test_find_invalid_missing_numpy_attr_raises(self): diff --git a/tests/functional/ext/docparams/raise/missing_raises_doc_Numpy.txt b/tests/functional/ext/docparams/raise/missing_raises_doc_Numpy.txt index 23be44f208..1cfdc062a4 100644 --- a/tests/functional/ext/docparams/raise/missing_raises_doc_Numpy.txt +++ b/tests/functional/ext/docparams/raise/missing_raises_doc_Numpy.txt @@ -3,7 +3,7 @@ unreachable:20:4:20:25:test_find_missing_numpy_raises:Unreachable code:HIGH unreachable:34:4:34:25:test_find_all_numpy_raises:Unreachable code:HIGH missing-raises-doc:37:0:37:35:test_find_rethrown_numpy_raises:"""RuntimeError"" not documented as being raised":HIGH missing-raises-doc:53:0:53:44:test_find_rethrown_numpy_multiple_raises:"""RuntimeError, ValueError"" not documented as being raised":HIGH -missing-raises-doc:111:0:111:45:test_find_valid_missing_numpy_attr_raises:"""PatternError"" not documented as being raised":HIGH +missing-raises-doc:111:0:111:45:test_find_valid_missing_numpy_attr_raises:"""IllegalMonthError"" not documented as being raised":HIGH missing-raises-doc:146:4:146:11:Foo.foo:"""AttributeError"" not documented as being raised":HIGH unreachable:158:8:158:17:Foo.foo:Unreachable code:HIGH unreachable:182:8:182:17:Foo.foo:Unreachable code:HIGH diff --git a/tests/functional/ext/docparams/raise/missing_raises_doc_Sphinx.py b/tests/functional/ext/docparams/raise/missing_raises_doc_Sphinx.py index 91a603b711..b9a301ed6f 100644 --- a/tests/functional/ext/docparams/raise/missing_raises_doc_Sphinx.py +++ b/tests/functional/ext/docparams/raise/missing_raises_doc_Sphinx.py @@ -123,21 +123,21 @@ def test_find_sphinx_attr_raises_exact_exc(self): def test_find_sphinx_attr_raises_substr_exc(self): """This is a sphinx docstring. - :raises re.error: Sometimes + :raises calendar.IllegalMonthError: Sometimes """ - from re import error + from calendar import IllegalMonthError - raise error("hi") + raise IllegalMonthError(-1) def test_find_valid_missing_sphinx_attr_raises(self): # [missing-raises-doc] """This is a sphinx docstring. - :raises re.anothererror: Sometimes + :raises calendar.anothererror: Sometimes """ - from re import error + from calendar import IllegalMonthError - raise error("hi") + raise IllegalMonthError(-1) def test_find_invalid_missing_sphinx_attr_raises(self): @@ -145,11 +145,11 @@ def test_find_invalid_missing_sphinx_attr_raises(self): pylint allows this to pass since the comparison between Raises and raise are based on the class name, not the qualified name. - :raises bogusmodule.error: Sometimes + :raises bogusmodule.IllegalMonthError: Sometimes """ - from re import error + from calendar import IllegalMonthError - raise error("hi") + raise IllegalMonthError(-1) class Foo: diff --git a/tests/functional/ext/docparams/raise/missing_raises_doc_Sphinx.txt b/tests/functional/ext/docparams/raise/missing_raises_doc_Sphinx.txt index e7a7388bee..568de3c4b3 100644 --- a/tests/functional/ext/docparams/raise/missing_raises_doc_Sphinx.txt +++ b/tests/functional/ext/docparams/raise/missing_raises_doc_Sphinx.txt @@ -10,4 +10,4 @@ missing-raises-doc:90:0:90:55:test_find_missing_sphinx_raises_infer_from_instanc unreachable:97:4:97:25:test_find_missing_sphinx_raises_infer_from_instance:Unreachable code:HIGH missing-raises-doc:100:0:100:55:test_find_missing_sphinx_raises_infer_from_function:"""RuntimeError"" not documented as being raised":HIGH unreachable:110:4:110:25:test_find_missing_sphinx_raises_infer_from_function:Unreachable code:HIGH -missing-raises-doc:133:0:133:46:test_find_valid_missing_sphinx_attr_raises:"""PatternError"" not documented as being raised":HIGH +missing-raises-doc:133:0:133:46:test_find_valid_missing_sphinx_attr_raises:"""IllegalMonthError"" not documented as being raised":HIGH