blob: ba17d43004b0e8163556e34a7ad24d3fc5c34019 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
"""Tests for XML reports from coverage.py."""
import os, sys
sys.path.insert(0, os.path.split(__file__)[0]) # Force relative import for Py3k
from coveragetest import CoverageTest
class XmlReportTest(CoverageTest):
"""Tests of the XML reports from coverage.py."""
def setUp(self):
super(XmlReportTest, self).setUp()
self.make_file("mycode.py", "print('hello')\n")
self.run_command("coverage run mycode.py")
def test_default_file_placement(self):
self.run_command("coverage xml")
self.assert_exists("coverage.xml")
def test_argument_affects_xml_placement(self):
self.run_command("coverage xml -o put_it_there.xml")
self.assert_doesnt_exist("coverage.xml")
self.assert_exists("put_it_there.xml")
def test_config_affects_xml_placement(self):
self.make_file(".coveragerc", "[xml]\noutput = xml.out\n")
self.run_command("coverage xml")
self.assert_doesnt_exist("coverage.xml")
self.assert_exists("xml.out")
|