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 | 5c98172ff46513e182196b59b2b432b416ce2010 (patch) | |
| tree | 21bc7db2c7cbf047b304c1f75333fa9ebaed3ef4 /tests | |
| parent | e825f492a3e5363b0e6d3bc41b76c54e91e2a174 (diff) | |
| download | python-coveragepy-5c98172ff46513e182196b59b2b432b416ce2010.tar.gz | |
New config option: run:note lets you annotate the data file.
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/test_config.py | 2 | ||||
| -rw-r--r-- | tests/test_process.py | 18 |
2 files changed, 18 insertions, 2 deletions
diff --git a/tests/test_config.py b/tests/test_config.py index 6234ac5..8b2b28f 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -1,4 +1,4 @@ -# -*- coding: utf-8 -*- +# coding: utf-8 # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt diff --git a/tests/test_process.py b/tests/test_process.py index 8255f98..e4fa741 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.") |
