diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2015-07-26 15:03:11 -0400 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2015-07-26 15:03:11 -0400 |
commit | dffe029fd2118edb145916c9f706af6522bd6274 (patch) | |
tree | 86ce0803b0326005921cb4944102a36c30b148c1 /tests/test_process.py | |
parent | 74a638cd9b04d64c9484444ea760499607253497 (diff) | |
download | python-coveragepy-git-dffe029fd2118edb145916c9f706af6522bd6274.tar.gz |
New config option: run:note lets you annotate the data file.
Diffstat (limited to 'tests/test_process.py')
-rw-r--r-- | tests/test_process.py | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/tests/test_process.py b/tests/test_process.py index 8255f98c..e4fa7417 100644 --- a/tests/test_process.py +++ b/tests/test_process.py @@ -1,3 +1,4 @@ +# coding: utf8 # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt @@ -10,7 +11,7 @@ import sys import textwrap import coverage -from coverage import env +from coverage import env, CoverageData from tests.coveragetest import CoverageTest @@ -534,6 +535,21 @@ class ProcessTest(CoverageTest): self.assertIn("Trace function changed", out) + def test_note(self): + self.make_file(".coveragerc", """\ + [run] + data_file = mydata.dat + note = These are musical notes: ♫𝅗𝅥♩ + """) + self.make_file("simple.py", """print('hello')""") + self.run_command("coverage run simple.py") + + data = CoverageData() + data.read_file("mydata.dat") + infos = data.run_infos() + self.assertEqual(len(infos), 1) + self.assertEqual(infos[0]['note'], u"These are musical notes: ♫𝅗𝅥♩") + def test_fullcoverage(self): # pragma: not covered if env.PY2: # This doesn't work on Python 2. self.skip("fullcoverage doesn't work on Python 2.") |