summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@redhat.com>2019-08-23 10:28:27 (GMT)
committerGitHub <noreply@github.com>2019-08-23 10:28:27 (GMT)
commit81446fd0d4fa60042ac2752350f31004324510f9 (patch)
tree8113c43f9f85c9f49532d4d75d5ae6a7481a2271
parent767434c39c8f3c6a8af1b3282d8382ccf809fe21 (diff)
downloadcpython-81446fd0d4fa60042ac2752350f31004324510f9.zip
cpython-81446fd0d4fa60042ac2752350f31004324510f9.tar.gz
cpython-81446fd0d4fa60042ac2752350f31004324510f9.tar.bz2
test_gdb: use unittest test discovery (GH-15405)
Replace test.support.run_unittest() with unittest.main() to automatically discover test cases, instead of having an maintaing manually a list which may be incomplete. Remove also an unused variable.
-rw-r--r--Lib/test/test_gdb.py16
1 files changed, 5 insertions, 11 deletions
diff --git a/Lib/test/test_gdb.py b/Lib/test/test_gdb.py
index e07d327..a2aa16c 100644
--- a/Lib/test/test_gdb.py
+++ b/Lib/test/test_gdb.py
@@ -13,7 +13,7 @@ import textwrap
import unittest
from test import support
-from test.support import run_unittest, findfile, python_is_optimized
+from test.support import findfile, python_is_optimized
def get_gdb_version():
try:
@@ -348,7 +348,6 @@ class PrettyPrintTests(DebuggerTests):
def check_repr(text):
try:
text.encode(encoding)
- printable = True
except UnicodeEncodeError:
self.assertGdbRepr(text, ascii(text))
else:
@@ -960,18 +959,13 @@ class PyLocalsTests(DebuggerTests):
self.assertMultilineMatches(bt,
r".*\na = 1\nb = 2\nc = 3\n.*")
-def test_main():
+
+def setUpModule():
if support.verbose:
print("GDB version %s.%s:" % (gdb_major_version, gdb_minor_version))
for line in gdb_version.splitlines():
print(" " * 4 + line)
- run_unittest(PrettyPrintTests,
- PyListTests,
- StackNavigationTests,
- PyBtTests,
- PyPrintTests,
- PyLocalsTests
- )
+
if __name__ == "__main__":
- test_main()
+ unittest.main()