Skip to content

Commit

Permalink
Merge pull request #420 from arcivanov/issue_419
Browse files Browse the repository at this point in the history
Flake8 3.2.0 broke the build
  • Loading branch information
arcivanov committed Nov 17, 2016
2 parents 00e1e4e + 79080f2 commit a02dca9
Show file tree
Hide file tree
Showing 20 changed files with 33 additions and 34 deletions.
Expand Up @@ -21,8 +21,7 @@
from integrationtest_support import IntegrationTestSupport


class Test (IntegrationTestSupport):

class Test(IntegrationTestSupport):
def test(self):
self.write_build_file("""
from pybuilder.core import use_plugin
Expand Down Expand Up @@ -60,5 +59,6 @@ def should_skip_test_sans_pyfix_test ():
self.assert_file_contains(
"target/reports/pyfix_unittest.json", '"tests-run": 1')


if __name__ == "__main__":
unittest.main()
Expand Up @@ -21,8 +21,7 @@
from integrationtest_support import IntegrationTestSupport


class Test (IntegrationTestSupport):

class Test(IntegrationTestSupport):
def test(self):
self.write_build_file("""
from pybuilder.core import use_plugin
Expand Down Expand Up @@ -53,5 +52,6 @@ def spam ():
pass
""")


if __name__ == "__main__":
unittest.main()
Expand Up @@ -50,5 +50,6 @@ def task_c(project):
self.assertFalse(project.get_property("a"))
self.assertTrue(project.get_property("c"))


if __name__ == "__main__":
unittest.main()
4 changes: 2 additions & 2 deletions src/integrationtest/python/should_filter_resources_tests.py
Expand Up @@ -21,8 +21,7 @@
from integrationtest_support import IntegrationTestSupport


class Test (IntegrationTestSupport):

class Test(IntegrationTestSupport):
def test(self):
self.write_build_file("""
from pybuilder.core import use_plugin, init
Expand All @@ -45,5 +44,6 @@ def init (project):
self.assert_file_content("target/spam", "1.0.dev0")
self.assert_file_content("target/eggs", "${version}")


if __name__ == "__main__":
unittest.main()
Expand Up @@ -21,8 +21,7 @@
from integrationtest_support import IntegrationTestSupport


class Test (IntegrationTestSupport):

class Test(IntegrationTestSupport):
def test(self):
self.write_build_file("""
from pybuilder.core import init, task
Expand All @@ -44,5 +43,6 @@ def any_task (project):
reactor = self.prepare_reactor()
reactor.build(environments=["test_environment"])


if __name__ == "__main__":
unittest.main()
Expand Up @@ -21,8 +21,7 @@
from integrationtest_support import IntegrationTestSupport


class Test (IntegrationTestSupport):

class Test(IntegrationTestSupport):
def test(self):
self.write_build_file("""
from pybuilder.core import use_plugin
Expand All @@ -40,5 +39,6 @@ def test(self):
self.assertTrue("clean" in task_names)
self.assertTrue("publish" in task_names)


if __name__ == "__main__":
unittest.main()
Expand Up @@ -21,8 +21,7 @@
from integrationtest_support import IntegrationTestSupport


class Test (IntegrationTestSupport):

class Test(IntegrationTestSupport):
def test(self):
self.write_build_file("""
from pybuilder.core import task
Expand All @@ -44,5 +43,6 @@ def my_task (): pass
self.assertEqual(
["a_task_with_overridden_name", "another_task", "my_task"], sorted(actual_task_names))


if __name__ == "__main__":
unittest.main()
Expand Up @@ -21,8 +21,7 @@
from integrationtest_support import IntegrationTestSupport


class Test (IntegrationTestSupport):

class Test(IntegrationTestSupport):
def test(self):
self.write_build_file("""
from pybuilder.core import task
Expand All @@ -36,5 +35,6 @@ def my_task (): pass
self.assertEquals(1, len(tasks))
self.assertEquals("my_task", tasks[0].name)


if __name__ == "__main__":
unittest.main()
Expand Up @@ -21,8 +21,7 @@
from integrationtest_support import IntegrationTestSupport


class Test (IntegrationTestSupport):

class Test(IntegrationTestSupport):
def test(self):
self.write_build_file("""
from pybuilder.core import init, task
Expand All @@ -42,5 +41,6 @@ def any_task (): pass
reactor = self.prepare_reactor()
reactor.build()


if __name__ == "__main__":
unittest.main()
Expand Up @@ -19,12 +19,10 @@
import unittest

from integrationtest_support import IntegrationTestSupport

from pybuilder.errors import PyBuilderException


class Test (IntegrationTestSupport):

class Test(IntegrationTestSupport):
def test(self):
self.write_build_file("""
from pybuilder.core import task
Expand All @@ -36,5 +34,6 @@ def spam (): pass

self.assertRaises(PyBuilderException, reactor.build)


if __name__ == "__main__":
unittest.main()
Expand Up @@ -19,12 +19,10 @@
import unittest

from integrationtest_support import IntegrationTestSupport

from pybuilder.errors import ProjectValidationFailedException


class Test (IntegrationTestSupport):

class Test(IntegrationTestSupport):
def test(self):
self.write_build_file("""
from pybuilder.core import init
Expand All @@ -39,5 +37,6 @@ def init (project):
self.assertRaises(
ProjectValidationFailedException, reactor.build, ["clean"])


if __name__ == "__main__":
unittest.main()
Expand Up @@ -21,8 +21,7 @@
from integrationtest_support import IntegrationTestSupport


class Test (IntegrationTestSupport):

class Test(IntegrationTestSupport):
def test(self):
self.write_build_file("""
from pybuilder.core import init
Expand Down Expand Up @@ -66,5 +65,6 @@ def should_run_pyfix_test ():
self.assert_file_contains(
"target/reports/pyfix_unittest.json", '"tests-run": 1')


if __name__ == "__main__":
unittest.main()
Expand Up @@ -48,5 +48,6 @@ def teardown_foo(project):
self.assertTrue(project.get_property("non_teardown_foo ran") is None)
self.assertTrue(project.get_property("teardown_foo completed"))


if __name__ == "__main__":
unittest.main()
Expand Up @@ -21,8 +21,7 @@
from integrationtest_support import IntegrationTestSupport


class Test (IntegrationTestSupport):

class Test(IntegrationTestSupport):
def test(self):
self.write_build_file("""
from pybuilder.core import use_plugin, init
Expand All @@ -43,5 +42,6 @@ def init (project):

self.assert_file_content("target/spam", "1.0.dev0 ${any_undefined_key}")


if __name__ == "__main__":
unittest.main()
Expand Up @@ -47,5 +47,6 @@ def teardown2_foo(project):
self.assertRaises(ValueError, reactor.build, "foo")
self.assertTrue(project.get_property("teardown2_foo completed"))


if __name__ == "__main__":
unittest.main()
Expand Up @@ -21,8 +21,7 @@
from integrationtest_support import IntegrationTestSupport


class Test (IntegrationTestSupport):

class Test(IntegrationTestSupport):
def test(self):
self.write_build_file("""
from pybuilder.core import use_plugin, init
Expand Down Expand Up @@ -67,5 +66,6 @@ def init (project):
include more_eggs
""")


if __name__ == "__main__":
unittest.main()
3 changes: 1 addition & 2 deletions src/integrationtest/python/should_write_setup_file_tests.py
Expand Up @@ -19,8 +19,7 @@
from integrationtest_support import IntegrationTestSupport


class Test (IntegrationTestSupport):

class Test(IntegrationTestSupport):
def test(self):
self.write_build_file("""
from pybuilder.core import use_plugin, init
Expand Down
Expand Up @@ -20,8 +20,7 @@
from integrationtest_support import IntegrationTestSupport


class Test (IntegrationTestSupport):

class Test(IntegrationTestSupport):
def test(self):
requirements = join(self.tmp_directory, "requirements.txt")
self.write_build_file("""
Expand Down
2 changes: 1 addition & 1 deletion src/main/python/pybuilder/plugins/python/flake8_plugin.py
Expand Up @@ -36,7 +36,7 @@

@init
def initialize_flake8_plugin(project):
project.plugin_depends_on("flake8")
project.plugin_depends_on("flake8", "~=3.2")

project.set_property_if_unset("flake8_break_build", False)
project.set_property_if_unset("flake8_max_line_length", 120)
Expand Down
2 changes: 1 addition & 1 deletion src/unittest/python/plugins/python/flake8_plugin_tests.py
Expand Up @@ -12,7 +12,7 @@ def setUp(self):
def test_should_set_dependency(self):
mock_project = Mock(Project)
initialize_flake8_plugin(mock_project)
mock_project.plugin_depends_on.assert_called_with('flake8')
mock_project.plugin_depends_on.assert_called_with('flake8', "~=3.2")

def test_should_leave_user_specified_properties_when_initializing_plugin(self):

Expand Down

0 comments on commit a02dca9

Please sign in to comment.