diff options
author | Mike <mehanig@gmail.com> | 2017-12-14 11:04:53 (GMT) |
---|---|---|
committer | Andrew Svetlov <andrew.svetlov@gmail.com> | 2017-12-14 11:04:53 (GMT) |
commit | 53f7a7c2814fbfd8a29200926601a32fa48bacb3 (patch) | |
tree | 4f74255b4cf6af46480b3e48bdc2411dfede9e15 /Lib/test/test_logging.py | |
parent | 5364b5cd7571f2dfa75acd37b388c14ac33fef73 (diff) | |
download | cpython-53f7a7c2814fbfd8a29200926601a32fa48bacb3.zip cpython-53f7a7c2814fbfd8a29200926601a32fa48bacb3.tar.gz cpython-53f7a7c2814fbfd8a29200926601a32fa48bacb3.tar.bz2 |
bpo-32297: Few misspellings found in Python source code comments. (#4803)
* Fix multiple typos in code comments
* Add spacing in comments (test_logging.py, test_math.py)
* Fix spaces at the beginning of comments in test_logging.py
Diffstat (limited to 'Lib/test/test_logging.py')
-rw-r--r-- | Lib/test/test_logging.py | 50 |
1 files changed, 25 insertions, 25 deletions
diff --git a/Lib/test/test_logging.py b/Lib/test/test_logging.py index 7101e3b..54049d2 100644 --- a/Lib/test/test_logging.py +++ b/Lib/test/test_logging.py @@ -178,7 +178,7 @@ class BuiltinLevelsTest(BaseTest): """Test builtin levels and their inheritance.""" def test_flat(self): - #Logging levels in a flat logger namespace. + # Logging levels in a flat logger namespace. m = self.next_message ERR = logging.getLogger("ERR") @@ -248,7 +248,7 @@ class BuiltinLevelsTest(BaseTest): ]) def test_nested_inherited(self): - #Logging levels in a nested namespace, inherited from parent loggers. + # Logging levels in a nested namespace, inherited from parent loggers. m = self.next_message INF = logging.getLogger("INF") @@ -1913,9 +1913,9 @@ class EncodingTest(BaseTest): def test_encoding_cyrillic_unicode(self): log = logging.getLogger("test") - #Get a message in Unicode: Do svidanya in Cyrillic (meaning goodbye) + # Get a message in Unicode: Do svidanya in Cyrillic (meaning goodbye) message = '\u0434\u043e \u0441\u0432\u0438\u0434\u0430\u043d\u0438\u044f' - #Ensure it's written in a Cyrillic encoding + # Ensure it's written in a Cyrillic encoding writer_class = codecs.getwriter('cp1251') writer_class.encoding = 'cp1251' stream = io.BytesIO() @@ -1929,7 +1929,7 @@ class EncodingTest(BaseTest): handler.close() # check we wrote exactly those bytes, ignoring trailing \n etc s = stream.getvalue() - #Compare against what the data should be when encoded in CP-1251 + # Compare against what the data should be when encoded in CP-1251 self.assertEqual(s, b'\xe4\xee \xf1\xe2\xe8\xe4\xe0\xed\xe8\xff\n') @@ -1950,7 +1950,7 @@ class WarningsTest(BaseTest): h.close() self.assertGreater(s.find("UserWarning: I'm warning you...\n"), 0) - #See if an explicit file uses the original implementation + # See if an explicit file uses the original implementation a_file = io.StringIO() warnings.showwarning("Explicit", UserWarning, "dummy.py", 42, a_file, "Dummy line") @@ -2091,7 +2091,7 @@ class ConfigDictTest(BaseTest): }, } - #As config1 but with a misspelt level on a handler + # As config1 but with a misspelt level on a handler config2a = { 'version': 1, 'formatters': { @@ -2119,7 +2119,7 @@ class ConfigDictTest(BaseTest): } - #As config1 but with a misspelt level on a logger + # As config1 but with a misspelt level on a logger config2b = { 'version': 1, 'formatters': { @@ -2286,8 +2286,8 @@ class ConfigDictTest(BaseTest): }, } - #config 7 does not define compiler.parser but defines compiler.lexer - #so compiler.parser should be disabled after applying it + # config 7 does not define compiler.parser but defines compiler.lexer + # so compiler.parser should be disabled after applying it config7 = { 'version': 1, 'formatters': { @@ -2432,7 +2432,7 @@ class ConfigDictTest(BaseTest): }, } - #As config1 but with a filter added + # As config1 but with a filter added config10 = { 'version': 1, 'formatters': { @@ -2466,7 +2466,7 @@ class ConfigDictTest(BaseTest): }, } - #As config1 but using cfg:// references + # As config1 but using cfg:// references config11 = { 'version': 1, 'true_formatters': { @@ -2497,7 +2497,7 @@ class ConfigDictTest(BaseTest): }, } - #As config11 but missing the version key + # As config11 but missing the version key config12 = { 'true_formatters': { 'form1' : { @@ -2527,7 +2527,7 @@ class ConfigDictTest(BaseTest): }, } - #As config11 but using an unsupported version + # As config11 but using an unsupported version config13 = { 'version': 2, 'true_formatters': { @@ -2728,7 +2728,7 @@ class ConfigDictTest(BaseTest): # Original logger output is empty. self.assert_log_lines([]) - #Same as test_config_7_ok but don't disable old loggers. + # Same as test_config_7_ok but don't disable old loggers. def test_config_8_ok(self): with support.captured_stdout() as output: self.apply_config(self.config1) @@ -2809,15 +2809,15 @@ class ConfigDictTest(BaseTest): with support.captured_stdout() as output: self.apply_config(self.config9) logger = logging.getLogger("compiler.parser") - #Nothing will be output since both handler and logger are set to WARNING + # Nothing will be output since both handler and logger are set to WARNING logger.info(self.next_message()) self.assert_log_lines([], stream=output) self.apply_config(self.config9a) - #Nothing will be output since both handler is still set to WARNING + # Nothing will be output since handler is still set to WARNING logger.info(self.next_message()) self.assert_log_lines([], stream=output) self.apply_config(self.config9b) - #Message should now be output + # Message should now be output logger.info(self.next_message()) self.assert_log_lines([ ('INFO', '3'), @@ -2829,13 +2829,13 @@ class ConfigDictTest(BaseTest): logger = logging.getLogger("compiler.parser") logger.warning(self.next_message()) logger = logging.getLogger('compiler') - #Not output, because filtered + # Not output, because filtered logger.warning(self.next_message()) logger = logging.getLogger('compiler.lexer') - #Not output, because filtered + # Not output, because filtered logger.warning(self.next_message()) logger = logging.getLogger("compiler.parser.codegen") - #Output, as not filtered + # Output, as not filtered logger.error(self.next_message()) self.assert_log_lines([ ('WARNING', '1'), @@ -2894,13 +2894,13 @@ class ConfigDictTest(BaseTest): logger = logging.getLogger("compiler.parser") logger.warning(self.next_message()) logger = logging.getLogger('compiler') - #Not output, because filtered + # Not output, because filtered logger.warning(self.next_message()) logger = logging.getLogger('compiler.lexer') - #Not output, because filtered + # Not output, because filtered logger.warning(self.next_message()) logger = logging.getLogger("compiler.parser.codegen") - #Output, as not filtered + # Output, as not filtered logger.error(self.next_message()) self.assert_log_lines([ ('WARNING', '1'), @@ -4335,7 +4335,7 @@ class TimedRotatingFileHandlerTest(BaseFileTest): break msg = 'No rotated files found, went back %d seconds' % GO_BACK if not found: - #print additional diagnostics + # print additional diagnostics dn, fn = os.path.split(self.fn) files = [f for f in os.listdir(dn) if f.startswith(fn)] print('Test time: %s' % now.strftime("%Y-%m-%d %H-%M-%S"), file=sys.stderr) |