summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_trace.py
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2018-02-17 06:53:24 (GMT)
committerGitHub <noreply@github.com>2018-02-17 06:53:24 (GMT)
commitafb5e5583694798793d44f35f901aa912ece278a (patch)
tree6d028f6af26a7eab5ca2c683fb042d8376f54180 /Lib/test/test_trace.py
parent025544a855ef3f3f7f21c1b6e4f19b47dcd30933 (diff)
downloadcpython-afb5e5583694798793d44f35f901aa912ece278a.zip
cpython-afb5e5583694798793d44f35f901aa912ece278a.tar.gz
cpython-afb5e5583694798793d44f35f901aa912ece278a.tar.bz2
bpo-32852: Fix trace changing sys.argv to tuple. (GH-5692)
(cherry picked from commit 9f4223261fd129ad7b9a09b2b0d625d1bb90b22b) Co-authored-by: Kyle Altendorf <sda@fstab.net>
Diffstat (limited to 'Lib/test/test_trace.py')
-rw-r--r--Lib/test/test_trace.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/Lib/test/test_trace.py b/Lib/test/test_trace.py
index 1d87aea..e04ca01 100644
--- a/Lib/test/test_trace.py
+++ b/Lib/test/test_trace.py
@@ -387,5 +387,15 @@ class TestCommandLine(unittest.TestCase):
status, stdout, stderr = assert_python_ok('-m', 'trace', '-l', TESTFN)
self.assertIn(b'functions called:', stdout)
+ def test_sys_argv_list(self):
+ with open(TESTFN, 'w') as fd:
+ self.addCleanup(unlink, TESTFN)
+ fd.write("import sys\n")
+ fd.write("print(type(sys.argv))\n")
+
+ status, direct_stdout, stderr = assert_python_ok(TESTFN)
+ status, trace_stdout, stderr = assert_python_ok('-m', 'trace', '-l', TESTFN)
+ self.assertIn(direct_stdout.strip(), trace_stdout)
+
if __name__ == '__main__':
unittest.main()