Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(86156)

Unified Diff: Lib/test/test_traceback.py

Issue 23670: Modifications to support iOS as a development platform
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Lib/test/test_thread.py ('k') | Lib/test/test_unicodedata.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
--- a/Lib/test/test_traceback.py Tue Mar 01 10:26:10 2016 +0200
+++ b/Lib/test/test_traceback.py Wed Mar 02 00:01:35 2016 +0000
@@ -1,13 +1,14 @@
"""Test cases for traceback module"""
from collections import namedtuple
from io import StringIO
import linecache
+import subprocess
import sys
import unittest
import re
from test import support
from test.support import TESTFN, Error, captured_output, unlink, cpython_only
from test.support.script_helper import assert_python_ok
import textwrap
@@ -105,21 +106,22 @@ class SyntaxTracebackCases(unittest.Test
else:
str_name = '.'.join([X.__module__, X.__qualname__])
self.assertEqual(err[0], "%s: %s\n" % (str_name, str_value))
def test_without_exception(self):
err = traceback.format_exception_only(None, None)
self.assertEqual(err, ['None\n'])
+ @unittest.skipUnless(hasattr(subprocess, 'Popen'), "test requires subprocess.Popen()")
def test_encoded_file(self):
# Test that tracebacks are correctly printed for encoded source files:
# - correct line number (Issue2384)
# - respect file encoding (Issue3975)
- import tempfile, sys, subprocess, os
+ import tempfile, sys, os
# The spawned subprocess has its stdout redirected to a PIPE, and its
# encoding may be different from the current interpreter, on Windows
# at least.
process = subprocess.Popen([sys.executable, "-c",
"import sys; print(sys.stdout.encoding)"],
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT)
« no previous file with comments | « Lib/test/test_thread.py ('k') | Lib/test/test_unicodedata.py » ('j') | no next file with comments »

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+