diff --git a/Lib/unittest/case.py b/Lib/unittest/case.py index 55c79d353539ca..8d0eaf029a0901 100644 --- a/Lib/unittest/case.py +++ b/Lib/unittest/case.py @@ -360,7 +360,8 @@ def __iter__(self): class TestCase(object): - """A class whose instances are single test cases. + """ + A class whose instances are single test cases. By default, the test code itself should be placed in a method named 'runTest'. @@ -381,15 +382,10 @@ class TestCase(object): in order to be run. When subclassing TestCase, you can set these attributes: - * failureException: determines which exception will be raised when - the instance's assertion methods fail; test methods raising this - exception will be deemed to have 'failed' rather than 'errored'. - * longMessage: determines whether long messages (including repr of - objects used in assert methods) will be printed on failure in *addition* - to any explicit message passed. - * maxDiff: sets the maximum length of a diff in failure messages - by assert methods using difflib. It is looked up as an instance - attribute so can be configured by individual tests if required. + + * failureException: determines which exception will be raised when the instance's assertion methods fail; test methods raising this exception will be deemed to have 'failed' rather than 'errored'. + * longMessage: determines whether long messages (including repr of objects used in assert methods) will be printed on failure in *addition* to any explicit message passed. + * maxDiff: sets the maximum length of a diff in failure messages by assert methods using difflib. It is looked up as an instance attribute so can be configured by individual tests if required. """ failureException = AssertionError diff --git a/Misc/NEWS.d/next/Documentation/2024-11-03-22-59-13.gh-issue-126378.oSRbN0.rst b/Misc/NEWS.d/next/Documentation/2024-11-03-22-59-13.gh-issue-126378.oSRbN0.rst new file mode 100644 index 00000000000000..747a8a15bb6758 --- /dev/null +++ b/Misc/NEWS.d/next/Documentation/2024-11-03-22-59-13.gh-issue-126378.oSRbN0.rst @@ -0,0 +1 @@ +Adjusted the indentation and formatting of the attribute list in the TestCase docstring to improve readability and avoid Sphinx documentation build errors.