diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2016-01-22 14:16:47 +0100 |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2016-01-22 14:16:47 +0100 |
commit | 22756f18bca783505d864d675d984444ae5633a6 (patch) | |
tree | 5223c017c3e42431509e5585b0d32c6b18edd4ea /Lib/test/test_gdb.py | |
parent | b02ef715a303ab09a39ef994d8f5acc4eb572376 (diff) | |
download | cpython-git-22756f18bca783505d864d675d984444ae5633a6.tar.gz |
Issue #25876: test_gdb: use subprocess._args_from_interpreter_flags() to test
Python with more options.
Diffstat (limited to 'Lib/test/test_gdb.py')
-rw-r--r-- | Lib/test/test_gdb.py | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/Lib/test/test_gdb.py b/Lib/test/test_gdb.py index 78fc55c2f2..cc5aab1d1e 100644 --- a/Lib/test/test_gdb.py +++ b/Lib/test/test_gdb.py @@ -176,6 +176,7 @@ class DebuggerTests(unittest.TestCase): args = ['--eval-command=%s' % cmd for cmd in commands] args += ["--args", sys.executable] + args.extend(subprocess._args_from_interpreter_flags()) if not import_site: # -S suppresses the default 'import site' @@ -301,7 +302,9 @@ class PrettyPrintTests(DebuggerTests): 'Verify the pretty-printing of dictionaries' self.assertGdbRepr({}) self.assertGdbRepr({'foo': 'bar'}, "{'foo': 'bar'}") - self.assertGdbRepr({'foo': 'bar', 'douglas': 42}, "{'douglas': 42, 'foo': 'bar'}") + # PYTHONHASHSEED is need to get the exact item order + if not sys.flags.ignore_environment: + self.assertGdbRepr({'foo': 'bar', 'douglas': 42}, "{'douglas': 42, 'foo': 'bar'}") def test_lists(self): 'Verify the pretty-printing of lists' @@ -379,9 +382,12 @@ id(s)''') 'Verify the pretty-printing of frozensets' if (gdb_major_version, gdb_minor_version) < (7, 3): self.skipTest("pretty-printing of frozensets needs gdb 7.3 or later") - self.assertGdbRepr(frozenset(), 'frozenset()') - self.assertGdbRepr(frozenset(['a', 'b']), "frozenset({'a', 'b'})") - self.assertGdbRepr(frozenset([4, 5, 6]), "frozenset({4, 5, 6})") + self.assertGdbRepr(frozenset(), "frozenset()") + self.assertGdbRepr(frozenset(['a']), "frozenset({'a'})") + # PYTHONHASHSEED is need to get the exact frozenset item order + if not sys.flags.ignore_environment: + self.assertGdbRepr(frozenset(['a', 'b']), "frozenset({'a', 'b'})") + self.assertGdbRepr(frozenset([4, 5, 6]), "frozenset({4, 5, 6})") def test_exceptions(self): # Test a RuntimeError @@ -510,6 +516,10 @@ id(foo)''') def test_builtins_help(self): 'Ensure that the new-style class _Helper in site.py can be handled' + + if sys.flags.no_site: + self.skipTest("need site module, but -S option was used") + # (this was the issue causing tracebacks in # http://bugs.python.org/issue8032#msg100537 ) gdb_repr, gdb_output = self.get_gdb_repr('id(__builtins__.help)', import_site=True) |