summaryrefslogtreecommitdiff
path: root/tests/test_process.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2021-05-01 13:02:31 -0400
committerNed Batchelder <ned@nedbatchelder.com>2021-05-01 13:30:39 -0400
commit9df434550a499c16e9fd26cfb9627837bfdc02a5 (patch)
tree5619ea3c3bec05d04363a66ced9c7ebffcefb1df /tests/test_process.py
parent3fe17c1f2244c07cf9d0f9e3609392c2ad441db1 (diff)
downloadpython-coveragepy-git-9df434550a499c16e9fd26cfb9627837bfdc02a5.tar.gz
refactor: remove code explicitly choosing between py2 and py3
Diffstat (limited to 'tests/test_process.py')
-rw-r--r--tests/test_process.py17
1 files changed, 1 insertions, 16 deletions
diff --git a/tests/test_process.py b/tests/test_process.py
index 9b451228..a73c650f 100644
--- a/tests/test_process.py
+++ b/tests/test_process.py
@@ -22,7 +22,6 @@ import coverage
from coverage import env
from coverage.data import line_counts
from coverage.files import abs_file, python_reported_file
-from coverage.misc import output_encoding
from tests.coveragetest import CoverageTest, TESTS_DIR
from tests.helpers import change_dir, make_file, nice_file, re_lines, run_command
@@ -734,7 +733,6 @@ class ProcessTest(CoverageTest):
@pytest.mark.expensive
@pytest.mark.skipif(env.METACOV, reason="Can't test fullcoverage when measuring ourselves")
- @pytest.mark.skipif(env.PY2, reason="fullcoverage doesn't work on Python 2.")
@pytest.mark.skipif(not env.C_TRACER, reason="fullcoverage only works with the C tracer.")
def test_fullcoverage(self):
# fullcoverage is a trick to get stdlib modules measured from
@@ -899,15 +897,8 @@ class EnvironmentTest(CoverageTest):
expected = self.run_command("python -m with_main")
actual = self.run_command("coverage run -m with_main")
- if env.PY2:
- assert expected.endswith("No module named with_main\n")
- assert actual.endswith("No module named with_main\n")
- else:
- self.assert_tryexecfile_output(expected, actual)
+ self.assert_tryexecfile_output(expected, actual)
- @pytest.mark.skipif(env.PY2,
- reason="Python 2 runs __main__ twice, I can't be bothered to make it work."
- )
def test_coverage_run_dashm_dir_with_init_is_like_python(self):
with open(TRY_EXECFILE) as f:
self.make_file("with_main/__main__.py", f.read())
@@ -1313,9 +1304,6 @@ class UnicodeFilePathsTest(CoverageTest):
u"TOTAL 1 0 100%\n"
)
- if env.PY2:
- report_expected = report_expected.encode(output_encoding())
-
out = self.run_command("coverage report")
assert out == report_expected
@@ -1359,9 +1347,6 @@ class UnicodeFilePathsTest(CoverageTest):
u"TOTAL 1 0 100%%\n"
) % os.sep
- if env.PY2:
- report_expected = report_expected.encode(output_encoding())
-
out = self.run_command("coverage report")
assert out == report_expected