29e139fcedc26c08b836eb2f597f84a3fc3018e4,contrib/python/tests/python/pants_test/contrib/python/checks/tasks/checkstyle/test_checkstyle.py,CheckstyleTest,test_lint_runs_for_multiple_whitelisted_constraints,#CheckstyleTest#,220

Before Change


    self.assertIn("3 Python Style issues found", str(task_error.exception))

  def test_lint_runs_for_multiple_whitelisted_constraints(self):
    self.create_file("a/python/fail_py2.py", contents=dedent(
                         x=2+3
                         print x+7
                       ))
    target_py2 = self.make_target("a/python:fail2", PythonLibrary, sources=["fail_py2.py"],
      compatibility=["CPython>=2.6"])
    self.create_file("a/python/fail_py3.py", contents=dedent(
                         x=2+3
                         print(x+7)
                       ))
    target_py3 = self.make_target("a/python:fail3", PythonLibrary, sources=["fail_py3.py"],
      compatibility=["CPython>=3.6"])
    self.set_options(interpreter_constraints_whitelist=["CPython>=2.6", "CPython>=3.6"])
    with self.assertRaises(TaskError) as task_error:
      self.execute_task(target_roots=[target_py2, target_py3])
    self.assertIn("7 Python Style issues found", str(task_error.exception))

After Change



  def test_lint_runs_for_multiple_whitelisted_constraints(self):
    target_py2 = self.create_py2_failing_target()
    target_py3 = self.create_py3_failing_target()
    self.set_options(interpreter_constraints_whitelist=[self.py2_constraint, self.py3_constraint])
    with self.assertRaises(TaskError) as task_error:
      self.execute_task(target_roots=[target_py2, target_py3])
    self.assertIn("7 Python Style issues found", str(task_error.exception))
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 10

Instances


Project Name: pantsbuild/pants
Commit Name: 29e139fcedc26c08b836eb2f597f84a3fc3018e4
Time: 2018-12-23
Author: ericarellano@me.com
File Name: contrib/python/tests/python/pants_test/contrib/python/checks/tasks/checkstyle/test_checkstyle.py
Class Name: CheckstyleTest
Method Name: test_lint_runs_for_multiple_whitelisted_constraints


Project Name: pantsbuild/pants
Commit Name: 29e139fcedc26c08b836eb2f597f84a3fc3018e4
Time: 2018-12-23
Author: ericarellano@me.com
File Name: contrib/python/tests/python/pants_test/contrib/python/checks/tasks/checkstyle/test_checkstyle.py
Class Name: CheckstyleTest
Method Name: test_lint_runs_for_default_constraints_and_matching_whitelist


Project Name: pantsbuild/pants
Commit Name: 29e139fcedc26c08b836eb2f597f84a3fc3018e4
Time: 2018-12-23
Author: ericarellano@me.com
File Name: contrib/python/tests/python/pants_test/contrib/python/checks/tasks/checkstyle/test_checkstyle.py
Class Name: CheckstyleTest
Method Name: test_lint_runs_for_multiple_whitelisted_constraints


Project Name: pantsbuild/pants
Commit Name: 29e139fcedc26c08b836eb2f597f84a3fc3018e4
Time: 2018-12-23
Author: ericarellano@me.com
File Name: contrib/python/tests/python/pants_test/contrib/python/checks/tasks/checkstyle/test_checkstyle.py
Class Name: CheckstyleTest
Method Name: test_lint_runs_for_single_whitelisted_constraints