def test_should_run_pylint_with_default_options(self, execute_tool): project = Project(".") init_pylint(project) execute_pylint(project, Mock(Logger)) execute_tool.assert_called_with(project, "pylint", ["pylint"] + DEFAULT_PYLINT_OPTIONS, True)
def test_should_run_pylint_with_default_options(self): init_pylint(self.project) execute_pylint(self.project, Mock(Logger), self.reactor) self.reactor.pybuilder_venv.execute_command.assert_called_with( ["pylint"] + DEFAULT_PYLINT_OPTIONS, ANY, env=ANY)
def test_should_break_build_when_warnings_and_set(self, execute_tool, warnings): project = Project(".") init_pylint(project) project.set_property("pylint_break_build", True) with self.assertRaises(BuildFailedException): execute_pylint(project, Mock(Logger))
def test_should_not_break_build_when_warnings_and_not_set( self, execute_tool, warnings): project = Project(".") init_pylint(project) project.set_property("pylint_break_build", False) execute_pylint(project, Mock(Logger))
def test_should_run_pylint_with_custom_options(self): init_pylint(self.project) self.project.set_property("pylint_options", ["--test", "-f", "--x=y"]) execute_pylint(self.project, Mock(Logger), self.reactor) self.reactor.pybuilder_venv.execute_command.assert_called_with( ["pylint", "--test", "-f", "--x=y"], ANY, env=ANY)
def test_should_run_pylint_with_custom_options(self, execute_tool): project = Project(".") init_pylint(project) project.set_property("pylint_options", ["--test", "-f", "--x=y"]) execute_pylint(project, Mock(Logger)) execute_tool.assert_called_with(project, "pylint", ["pylint", "--test", "-f", "--x=y"], True)
def test_should_not_break_build_when_no_warnings_and_set(self, *_): init_pylint(self.project) self.project.set_property("pylint_break_build", True) execute_pylint(self.project, Mock(Logger), self.reactor)
def test_should_break_build_when_warnings_and_set(self, *_): init_pylint(self.project) self.project.set_property("pylint_break_build", True) with self.assertRaises(BuildFailedException): execute_pylint(self.project, Mock(Logger), self.reactor)
def test_should_not_break_build_when_no_warnings_and_set(self, execute_tool, warnings): project = Project(".") init_pylint(project) project.set_property("pylint_break_build", True) execute_pylint(project, Mock(Logger))