summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2015-01-22 23:31:41 -0500
committerNed Batchelder <ned@nedbatchelder.com>2015-01-22 23:31:41 -0500
commitf8aeaee83f1591b3bc524f8880c858f18da4a2fd (patch)
tree8b1c7a53387c9a0936ab6a4b6ccfb8ab300f9915
parent91e36892778bc327cffe91da2cce4784a5ea102c (diff)
downloadpython-coveragepy-git-f8aeaee83f1591b3bc524f8880c858f18da4a2fd.tar.gz
Clarify how to use make_file for non-ascii content.
-rw-r--r--coverage/test_helpers.py12
-rw-r--r--tests/test_testing.py5
2 files changed, 12 insertions, 5 deletions
diff --git a/coverage/test_helpers.py b/coverage/test_helpers.py
index 665593a2..b49e75d8 100644
--- a/coverage/test_helpers.py
+++ b/coverage/test_helpers.py
@@ -189,10 +189,14 @@ class TempDirMixin(SysPathAwareMixin, ModuleAwareMixin, TestCase):
"""Create a file for testing.
`filename` is the relative path to the file, including directories if
- desired, which will be created if need be. `text` is the content to
- create in the file. If `newline` is provided, it is a string that will
- be used as the line endings in the created file, otherwise the line
- endings are as provided in `text`.
+ desired, which will be created if need be.
+
+ `text` is the content to create in the file, a native string (bytes in
+ Python 2, unicode in Python 3).
+
+ If `newline` is provided, it is a string that will be used as the line
+ endings in the created file, otherwise the line endings are as provided
+ in `text`.
Returns `filename`.
diff --git a/tests/test_testing.py b/tests/test_testing.py
index 10370e54..75db7e50 100644
--- a/tests/test_testing.py
+++ b/tests/test_testing.py
@@ -1,9 +1,12 @@
# -*- coding: utf-8 -*-
"""Tests that our test infrastructure is really working!"""
-import os, sys
+import os
+import sys
+
from coverage.backunittest import TestCase
from coverage.backward import to_bytes
+
from tests.coveragetest import TempDirMixin, CoverageTest