summaryrefslogtreecommitdiff
path: root/tests/test_phystokens.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2013-12-13 22:45:10 -0500
committerNed Batchelder <ned@nedbatchelder.com>2013-12-13 22:45:10 -0500
commit2df9b1c35cbb5c92204fc5923368a3d619a34f6d (patch)
treed1ede8ffef812ba4e345b08f698f001ebe69cb56 /tests/test_phystokens.py
parent84221611890880b749dbb650e8d07ac8918dba46 (diff)
parent7c66441eab3af17539c478a2cb4e19cd93ba0cf4 (diff)
downloadpython-coveragepy-git-2df9b1c35cbb5c92204fc5923368a3d619a34f6d.tar.gz
Merged 4.0 to default
Diffstat (limited to 'tests/test_phystokens.py')
-rw-r--r--tests/test_phystokens.py11
1 files changed, 3 insertions, 8 deletions
diff --git a/tests/test_phystokens.py b/tests/test_phystokens.py
index c1e51f1c..9ff053c4 100644
--- a/tests/test_phystokens.py
+++ b/tests/test_phystokens.py
@@ -29,7 +29,7 @@ class PhysTokensTest(CoverageTest):
"""Tokenize `source`, then put it back together, should be the same."""
tokenized = ""
for line in source_token_lines(source):
- text = "".join([t for _,t in line])
+ text = "".join(t for _, t in line)
tokenized += text + "\n"
# source_token_lines doesn't preserve trailing spaces, so trim all that
# before comparing.
@@ -86,11 +86,6 @@ if sys.version_info < (3, 0):
run_in_temp_dir = False
- if sys.version_info >= (2,4):
- default_encoding = 'ascii'
- else:
- default_encoding = 'iso-8859-1'
-
def test_detect_source_encoding(self):
# Various forms from http://www.python.org/dev/peps/pep-0263/
source = "# coding=cp850\n\n"
@@ -110,11 +105,11 @@ if sys.version_info < (3, 0):
def test_dont_detect_source_encoding_on_third_line(self):
# A coding declaration doesn't count on the third line.
source = "\n\n# coding=cp850\n\n"
- self.assertEqual(source_encoding(source), self.default_encoding)
+ self.assertEqual(source_encoding(source), 'ascii')
def test_detect_source_encoding_of_empty_file(self):
# An important edge case.
- self.assertEqual(source_encoding(""), self.default_encoding)
+ self.assertEqual(source_encoding(""), 'ascii')
def test_bom(self):
# A BOM means utf-8.