@@ -178,7 +178,7 @@ class BuiltinLevelsTest(BaseTest):
178178 """Test builtin levels and their inheritance."""
179179
180180 def test_flat (self ):
181- #Logging levels in a flat logger namespace.
181+ # Logging levels in a flat logger namespace.
182182 m = self .next_message
183183
184184 ERR = logging .getLogger ("ERR" )
@@ -248,7 +248,7 @@ def test_nested_explicit(self):
248248 ])
249249
250250 def test_nested_inherited (self ):
251- #Logging levels in a nested namespace, inherited from parent loggers.
251+ # Logging levels in a nested namespace, inherited from parent loggers.
252252 m = self .next_message
253253
254254 INF = logging .getLogger ("INF" )
@@ -1913,9 +1913,9 @@ def test_encoding_plain_file(self):
19131913
19141914 def test_encoding_cyrillic_unicode (self ):
19151915 log = logging .getLogger ("test" )
1916- #Get a message in Unicode: Do svidanya in Cyrillic (meaning goodbye)
1916+ # Get a message in Unicode: Do svidanya in Cyrillic (meaning goodbye)
19171917 message = '\u0434 \u043e \u0441 \u0432 \u0438 \u0434 \u0430 \u043d \u0438 \u044f '
1918- #Ensure it's written in a Cyrillic encoding
1918+ # Ensure it's written in a Cyrillic encoding
19191919 writer_class = codecs .getwriter ('cp1251' )
19201920 writer_class .encoding = 'cp1251'
19211921 stream = io .BytesIO ()
@@ -1929,7 +1929,7 @@ def test_encoding_cyrillic_unicode(self):
19291929 handler .close ()
19301930 # check we wrote exactly those bytes, ignoring trailing \n etc
19311931 s = stream .getvalue ()
1932- #Compare against what the data should be when encoded in CP-1251
1932+ # Compare against what the data should be when encoded in CP-1251
19331933 self .assertEqual (s , b'\xe4 \xee \xf1 \xe2 \xe8 \xe4 \xe0 \xed \xe8 \xff \n ' )
19341934
19351935
@@ -1950,7 +1950,7 @@ def test_warnings(self):
19501950 h .close ()
19511951 self .assertGreater (s .find ("UserWarning: I'm warning you...\n " ), 0 )
19521952
1953- #See if an explicit file uses the original implementation
1953+ # See if an explicit file uses the original implementation
19541954 a_file = io .StringIO ()
19551955 warnings .showwarning ("Explicit" , UserWarning , "dummy.py" , 42 ,
19561956 a_file , "Dummy line" )
@@ -2091,7 +2091,7 @@ class ConfigDictTest(BaseTest):
20912091 },
20922092 }
20932093
2094- #As config1 but with a misspelt level on a handler
2094+ # As config1 but with a misspelt level on a handler
20952095 config2a = {
20962096 'version' : 1 ,
20972097 'formatters' : {
@@ -2119,7 +2119,7 @@ class ConfigDictTest(BaseTest):
21192119 }
21202120
21212121
2122- #As config1 but with a misspelt level on a logger
2122+ # As config1 but with a misspelt level on a logger
21232123 config2b = {
21242124 'version' : 1 ,
21252125 'formatters' : {
@@ -2286,8 +2286,8 @@ class ConfigDictTest(BaseTest):
22862286 },
22872287 }
22882288
2289- #config 7 does not define compiler.parser but defines compiler.lexer
2290- #so compiler.parser should be disabled after applying it
2289+ # config 7 does not define compiler.parser but defines compiler.lexer
2290+ # so compiler.parser should be disabled after applying it
22912291 config7 = {
22922292 'version' : 1 ,
22932293 'formatters' : {
@@ -2432,7 +2432,7 @@ class ConfigDictTest(BaseTest):
24322432 },
24332433 }
24342434
2435- #As config1 but with a filter added
2435+ # As config1 but with a filter added
24362436 config10 = {
24372437 'version' : 1 ,
24382438 'formatters' : {
@@ -2466,7 +2466,7 @@ class ConfigDictTest(BaseTest):
24662466 },
24672467 }
24682468
2469- #As config1 but using cfg:// references
2469+ # As config1 but using cfg:// references
24702470 config11 = {
24712471 'version' : 1 ,
24722472 'true_formatters' : {
@@ -2497,7 +2497,7 @@ class ConfigDictTest(BaseTest):
24972497 },
24982498 }
24992499
2500- #As config11 but missing the version key
2500+ # As config11 but missing the version key
25012501 config12 = {
25022502 'true_formatters' : {
25032503 'form1' : {
@@ -2527,7 +2527,7 @@ class ConfigDictTest(BaseTest):
25272527 },
25282528 }
25292529
2530- #As config11 but using an unsupported version
2530+ # As config11 but using an unsupported version
25312531 config13 = {
25322532 'version' : 2 ,
25332533 'true_formatters' : {
@@ -2728,7 +2728,7 @@ def test_config7_ok(self):
27282728 # Original logger output is empty.
27292729 self .assert_log_lines ([])
27302730
2731- #Same as test_config_7_ok but don't disable old loggers.
2731+ # Same as test_config_7_ok but don't disable old loggers.
27322732 def test_config_8_ok (self ):
27332733 with support .captured_stdout () as output :
27342734 self .apply_config (self .config1 )
@@ -2809,15 +2809,15 @@ def test_config_9_ok(self):
28092809 with support .captured_stdout () as output :
28102810 self .apply_config (self .config9 )
28112811 logger = logging .getLogger ("compiler.parser" )
2812- #Nothing will be output since both handler and logger are set to WARNING
2812+ # Nothing will be output since both handler and logger are set to WARNING
28132813 logger .info (self .next_message ())
28142814 self .assert_log_lines ([], stream = output )
28152815 self .apply_config (self .config9a )
28162816 # Nothing will be output since handler is still set to WARNING
28172817 logger .info (self .next_message ())
28182818 self .assert_log_lines ([], stream = output )
28192819 self .apply_config (self .config9b )
2820- #Message should now be output
2820+ # Message should now be output
28212821 logger .info (self .next_message ())
28222822 self .assert_log_lines ([
28232823 ('INFO' , '3' ),
@@ -2829,13 +2829,13 @@ def test_config_10_ok(self):
28292829 logger = logging .getLogger ("compiler.parser" )
28302830 logger .warning (self .next_message ())
28312831 logger = logging .getLogger ('compiler' )
2832- #Not output, because filtered
2832+ # Not output, because filtered
28332833 logger .warning (self .next_message ())
28342834 logger = logging .getLogger ('compiler.lexer' )
2835- #Not output, because filtered
2835+ # Not output, because filtered
28362836 logger .warning (self .next_message ())
28372837 logger = logging .getLogger ("compiler.parser.codegen" )
2838- #Output, as not filtered
2838+ # Output, as not filtered
28392839 logger .error (self .next_message ())
28402840 self .assert_log_lines ([
28412841 ('WARNING' , '1' ),
@@ -2894,13 +2894,13 @@ def test_listen_config_10_ok(self):
28942894 logger = logging .getLogger ("compiler.parser" )
28952895 logger .warning (self .next_message ())
28962896 logger = logging .getLogger ('compiler' )
2897- #Not output, because filtered
2897+ # Not output, because filtered
28982898 logger .warning (self .next_message ())
28992899 logger = logging .getLogger ('compiler.lexer' )
2900- #Not output, because filtered
2900+ # Not output, because filtered
29012901 logger .warning (self .next_message ())
29022902 logger = logging .getLogger ("compiler.parser.codegen" )
2903- #Output, as not filtered
2903+ # Output, as not filtered
29042904 logger .error (self .next_message ())
29052905 self .assert_log_lines ([
29062906 ('WARNING' , '1' ),
@@ -4335,7 +4335,7 @@ def test_rollover(self):
43354335 break
43364336 msg = 'No rotated files found, went back %d seconds' % GO_BACK
43374337 if not found :
4338- #print additional diagnostics
4338+ # print additional diagnostics
43394339 dn , fn = os .path .split (self .fn )
43404340 files = [f for f in os .listdir (dn ) if f .startswith (fn )]
43414341 print ('Test time: %s' % now .strftime ("%Y-%m-%d %H-%M-%S" ), file = sys .stderr )
0 commit comments