File tree Expand file tree Collapse file tree 1 file changed +10
-10
lines changed Expand file tree Collapse file tree 1 file changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -12,17 +12,17 @@ def runTest(self):
1212
1313 p = Preprocessor ()
1414 p .parse (self .input )
15- oh = StringIO ()
16- p .write (oh )
17- print ("ok" )
18- if oh .getvalue () != self .output :
19- print ("Should be:\n " + self .output + "EOF\n " , file = sys .stderr )
20- print ("\n Was:\n " + oh .getvalue ()+ "EOF\n " , file = sys .stderr )
21- self .assertEqual (p .return_code , 0 )
22- self .assertEqual (oh .getvalue (), self .output )
15+ with StringIO () as oh :
16+ p .write (oh )
17+ print ("ok" )
18+ if oh .getvalue () != self .output :
19+ print ("Should be:\n " + self .output + "EOF\n " , file = sys .stderr )
20+ print ("\n Was:\n " + oh .getvalue ()+ "EOF\n " , file = sys .stderr )
21+ self .assertEqual (p .return_code , 0 )
22+ self .assertEqual (oh .getvalue (), self .output )
2323
2424class pp_number_pasting (unittest .TestCase , runner ):
25- input = r """#define CAT_(A,B)A##B
25+ input = """#define CAT_(A,B)A##B
2626#define CAT(A,B)CAT_(A,B)
2727#define Ox 0x
2828#if CAT(Ox,1)
@@ -31,7 +31,7 @@ class pp_number_pasting(unittest.TestCase, runner):
3131PP_NUMBER paste fail
3232#endif
3333"""
34- output = r """
34+ output = """
3535
3636
3737
You can’t perform that action at this time.
0 commit comments