Skip to content

test_gdb: use unittest test discovery #15405

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 23, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 5 additions & 11 deletions Lib/test/test_gdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
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:
Expand Down Expand Up @@ -348,7 +348,6 @@ def test_strings(self):
def check_repr(text):
try:
text.encode(encoding)
printable = True
except UnicodeEncodeError:
self.assertGdbRepr(text, ascii(text))
else:
Expand Down Expand Up @@ -960,18 +959,13 @@ def test_locals_after_up(self):
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()