summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_logging.py
diff options
context:
space:
mode:
authorAndrew Svetlov <andrew.svetlov@gmail.com>2017-12-14 14:19:51 (GMT)
committerGitHub <noreply@github.com>2017-12-14 14:19:51 (GMT)
commit28453feaa8d88bbcbf6d834b1d5ca396d17265f2 (patch)
treee228f9ddb6795965d302e6d16c2e4bfb0b074d17 /Lib/test/test_logging.py
parent645fa19f15cddeec8d882a9e1420173e7516f0e4 (diff)
downloadcpython-28453feaa8d88bbcbf6d834b1d5ca396d17265f2.zip
cpython-28453feaa8d88bbcbf6d834b1d5ca396d17265f2.tar.gz
cpython-28453feaa8d88bbcbf6d834b1d5ca396d17265f2.tar.bz2
[3.6] bpo-32297: Fix misspellings in Python source code comments (GH-4803) (#4864)
* [3.6] bpo-32297: Few misspellings found in Python source code comments. (GH-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. (cherry picked from commit 53f7a7c2814fbfd8a29200926601a32fa48bacb3)
Diffstat (limited to 'Lib/test/test_logging.py')
-rw-r--r--Lib/test/test_logging.py50
1 files changed, 25 insertions, 25 deletions
diff --git a/Lib/test/test_logging.py b/Lib/test/test_logging.py
index b325f76..fc06713 100644
--- a/Lib/test/test_logging.py
+++ b/Lib/test/test_logging.py
@@ -174,7 +174,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")
@@ -244,7 +244,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")
@@ -1901,9 +1901,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()
@@ -1917,7 +1917,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')
@@ -1938,7 +1938,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")
@@ -2079,7 +2079,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': {
@@ -2107,7 +2107,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': {
@@ -2274,8 +2274,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': {
@@ -2420,7 +2420,7 @@ class ConfigDictTest(BaseTest):
},
}
- #As config1 but with a filter added
+ # As config1 but with a filter added
config10 = {
'version': 1,
'formatters': {
@@ -2454,7 +2454,7 @@ class ConfigDictTest(BaseTest):
},
}
- #As config1 but using cfg:// references
+ # As config1 but using cfg:// references
config11 = {
'version': 1,
'true_formatters': {
@@ -2485,7 +2485,7 @@ class ConfigDictTest(BaseTest):
},
}
- #As config11 but missing the version key
+ # As config11 but missing the version key
config12 = {
'true_formatters': {
'form1' : {
@@ -2515,7 +2515,7 @@ class ConfigDictTest(BaseTest):
},
}
- #As config11 but using an unsupported version
+ # As config11 but using an unsupported version
config13 = {
'version': 2,
'true_formatters': {
@@ -2716,7 +2716,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)
@@ -2797,15 +2797,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'),
@@ -2817,13 +2817,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'),
@@ -2884,13 +2884,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'),
@@ -4244,7 +4244,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)