allpy
view test/test_silence.py @ 1168:b556c96c6719
blocks3d/www Makefile: never check certificates of github, they are too confusing for wget
author | Daniil Alexeyevsky <dendik@kodomo.fbb.msu.ru> |
---|---|
date | Mon, 26 May 2014 17:20:29 +0400 |
parents | |
children |
line source
1 """Test for allpy.util.Silence
3 >>> print check_output(["python", __file__], stderr=STDOUT)
4 Example1
5 Stdout must be seen (only stderr silenced)
6 Example2
7 Example3
8 Stdout must be seen (error raised)
9 Example4
10 Stdout must be seen (only stderr silenced)
11 Example5
12 Example6
13 Stdout must be seen (error raised)
14 Stderr must be seen too
15 ...
16 done
17 <BLANKLINE>
19 """
25 """`check_output` is only introduced in 2.7, we need it NOW"""
32 """Fix python stdIO buffering by wrapping this around stdout/stderr.
34 Python uses different buffering strategies in interactive and
35 non-interactive invocations making this test output look ugly and
36 difficult to understand. This class is a crutch for the problem.
37 """
48 # Only make uniform buffering when running as __main__ program.
49 # Otherwise, importing this module would cripple interactive interpreter.
71 pass
92 pass