summaryrefslogtreecommitdiffstats
path: root/Lib/doctest.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2019-05-06 19:29:40 (GMT)
committerGitHub <noreply@github.com>2019-05-06 19:29:40 (GMT)
commit96aeaec64738b730c719562125070a52ed570210 (patch)
treed68994f93014d081e9a441e7bf7dfda3aaadd402 /Lib/doctest.py
parent964663089547ca110199e23867b46b07ff4be88c (diff)
downloadcpython-96aeaec64738b730c719562125070a52ed570210.zip
cpython-96aeaec64738b730c719562125070a52ed570210.tar.gz
cpython-96aeaec64738b730c719562125070a52ed570210.tar.bz2
bpo-36793: Remove unneeded __str__ definitions. (GH-13081)
Classes that define __str__ the same as __repr__ can just inherit it from object.
Diffstat (limited to 'Lib/doctest.py')
-rw-r--r--Lib/doctest.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/Lib/doctest.py b/Lib/doctest.py
index 79d91a0..bf4889f 100644
--- a/Lib/doctest.py
+++ b/Lib/doctest.py
@@ -2300,7 +2300,7 @@ class DocTestCase(unittest.TestCase):
name = self._dt_test.name.split('.')
return "%s (%s)" % (name[-1], '.'.join(name[:-1]))
- __str__ = __repr__
+ __str__ = object.__str__
def shortDescription(self):
return "Doctest: " + self._dt_test.name
@@ -2399,7 +2399,6 @@ class DocFileCase(DocTestCase):
def __repr__(self):
return self._dt_test.filename
- __str__ = __repr__
def format_failure(self, err):
return ('Failed doctest test for %s\n File "%s", line 0\n\n%s'