69a95616bc5ab498166adf939e5634e6fa2ff0ae,tests/python/pants_test/backend/python/tasks/test_pytest_run.py,PythonTestBuilderTest,test_junit_xml_option,#PythonTestBuilderTest#,187

Before Change



  def test_junit_xml_option(self):
    basedir = os.path.join(self.build_root, "dist", "junit_option")
    self.assert_expected_junit_xml(basedir, junit_xml_dir=basedir)

  def test_junit_xml_env(self):
    basedir = os.path.join(self.build_root, "dist", "junit_env")
    with environment_as(JUNIT_XML_BASE=basedir):

After Change


    files = glob.glob(os.path.join(report_basedir, "*.xml"))
    self.assertEqual(1, len(files), "Expected 1 file, found: {}".format(files))
    junit_xml = files[0]
    root = DOM.parse(junit_xml).documentElement

    self.assertEqual(2, len(root.childNodes))
    self.assertEqual(2, int(root.getAttribute("tests")))
    self.assertEqual(1, int(root.getAttribute("failures")))
    self.assertEqual(0, int(root.getAttribute("errors")))
    self.assertEqual(0, int(root.getAttribute("skips")))

    children_by_test_name = dict((elem.getAttribute("name"), elem) for elem in root.childNodes)
    self.assertEqual(0, len(children_by_test_name["test_one"].childNodes))
    self.assertEqual(1, len(children_by_test_name["test_two"].childNodes))
    self.assertEqual("failure", children_by_test_name["test_two"].firstChild.nodeName)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: pantsbuild/pants
Commit Name: 69a95616bc5ab498166adf939e5634e6fa2ff0ae
Time: 2015-07-10
Author: john.sirois@gmail.com
File Name: tests/python/pants_test/backend/python/tasks/test_pytest_run.py
Class Name: PythonTestBuilderTest
Method Name: test_junit_xml_option


Project Name: chakki-works/doccano
Commit Name: a07dd1863bbad48a3214ea67bff36f1f4847baaa
Time: 2019-07-19
Author: null
File Name: app/api/tests/test_utils.py
Class Name: TestCoNLLParser
Method Name: test_calc_char_offset


Project Name: snipsco/snips-nlu
Commit Name: 9cecc52e1fbf8b281d88244f6c43d2b76e374993
Time: 2018-02-07
Author: adrien.ball@snips.net
File Name: snips_nlu/nlu_engine/nlu_engine.py
Class Name: SnipsNLUEngine
Method Name: parse