@@ -567,7 +567,6 @@ def test_directive_preserve_input(self):
567
567
self .expect_failure (block , err , lineno = 6 )
568
568
569
569
def test_directive_preserve_output (self ):
570
- err = "'preserve' only works for blocks that don't produce any output!"
571
570
block = dedent ("""
572
571
/*[clinic input]
573
572
output everything buffer
@@ -965,7 +964,6 @@ def test_param_no_docstring(self):
965
964
follow_symlinks: bool = True
966
965
something_else: str = ''
967
966
""" )
968
- p = function .parameters ['follow_symlinks' ]
969
967
self .assertEqual (3 , len (function .parameters ))
970
968
conv = function .parameters ['something_else' ].converter
971
969
self .assertIsInstance (conv , clinic .str_converter )
@@ -1929,17 +1927,14 @@ def test_scaffolding(self):
1929
1927
self .assertEqual (repr (clinic .NULL ), '<Null>' )
1930
1928
1931
1929
# test that fail fails
1932
- expected = (
1933
- 'Error in file "clown.txt" on line 69:\n '
1934
- 'The igloos are melting!\n '
1935
- )
1936
1930
with support .captured_stdout () as stdout :
1937
1931
errmsg = 'The igloos are melting'
1938
1932
with self .assertRaisesRegex (clinic .ClinicError , errmsg ) as cm :
1939
1933
clinic .fail (errmsg , filename = 'clown.txt' , line_number = 69 )
1940
1934
exc = cm .exception
1941
1935
self .assertEqual (exc .filename , 'clown.txt' )
1942
1936
self .assertEqual (exc .lineno , 69 )
1937
+ self .assertEqual (stdout .getvalue (), "" )
1943
1938
1944
1939
def test_non_ascii_character_in_docstring (self ):
1945
1940
block = """
@@ -2408,7 +2403,7 @@ def test_file_dest(self):
2408
2403
"not overwriting!" )
2409
2404
self .assertIn (expected_err , err )
2410
2405
# Run clinic again, this time with the -f option.
2411
- out = self .expect_success ("-f" , in_fn )
2406
+ _ = self .expect_success ("-f" , in_fn )
2412
2407
# Read back the generated output.
2413
2408
with open (in_fn , encoding = "utf-8" ) as f :
2414
2409
data = f .read ()
0 commit comments