Back to index

python3.2  3.2.2
Public Member Functions
lib2to3.tests.test_main.TestMain Class Reference

List of all members.

Public Member Functions

def tearDown
def run_2to3_capture
def test_unencodable_diff

Detailed Description

Definition at line 11 of file test_main.py.


Member Function Documentation

def lib2to3.tests.test_main.TestMain.run_2to3_capture (   self,
  args,
  in_capture,
  out_capture,
  err_capture 
)

Definition at line 17 of file test_main.py.

00017 
00018     def run_2to3_capture(self, args, in_capture, out_capture, err_capture):
00019         save_stdin = sys.stdin
00020         save_stdout = sys.stdout
00021         save_stderr = sys.stderr
00022         sys.stdin = in_capture
00023         sys.stdout = out_capture
00024         sys.stderr = err_capture
00025         try:
00026             return main.main("lib2to3.fixes", args)
00027         finally:
00028             sys.stdin = save_stdin
00029             sys.stdout = save_stdout
00030             sys.stderr = save_stderr

Here is the caller graph for this function:

Definition at line 13 of file test_main.py.

00013 
00014     def tearDown(self):
00015         # Clean up logging configuration down by main.
00016         del logging.root.handlers[:]

Here is the caller graph for this function:

Definition at line 31 of file test_main.py.

00031 
00032     def test_unencodable_diff(self):
00033         input_stream = io.StringIO("print 'nothing'\nprint u'├╝ber'\n")
00034         out = io.BytesIO()
00035         out_enc = codecs.getwriter("ascii")(out)
00036         err = io.StringIO()
00037         ret = self.run_2to3_capture(["-"], input_stream, out_enc, err)
00038         self.assertEqual(ret, 0)
00039         output = out.getvalue().decode("ascii")
00040         self.assertTrue("-print 'nothing'" in output)
00041         self.assertTrue("WARNING: couldn't encode <stdin>'s diff for "
00042                         "your terminal" in err.getvalue())

Here is the call graph for this function:


The documentation for this class was generated from the following file: