From 819827a42ddb364f98c3a1a7eae2536dc54bc4cc Mon Sep 17 00:00:00 2001 From: David Pursehouse Date: Wed, 12 Feb 2020 15:20:19 +0900 Subject: Fix blank line issues reported by flake8 - E301 expected 1 blank line - E302 expected 2 blank lines - E303 too many blank lines - E305 expected 2 blank lines after class or function definition - E306 expected 1 blank line before a nested definition Fixed automatically with autopep8: git ls-files | grep py$ | xargs autopep8 --in-place \ --select E301,E302,E303,E305,E306 Manually fix issues in project.py caused by misuse of block comments. Change-Id: Iee840fcaff48aae504ddac9c3e76d2acd484f6a9 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/254599 Reviewed-by: Mike Frysinger Tested-by: David Pursehouse --- tests/test_git_config.py | 4 ++++ tests/test_wrapper.py | 4 ++++ 2 files changed, 8 insertions(+) (limited to 'tests') diff --git a/tests/test_git_config.py b/tests/test_git_config.py index b735f27f..6aa6b381 100644 --- a/tests/test_git_config.py +++ b/tests/test_git_config.py @@ -23,14 +23,17 @@ import unittest import git_config + def fixture(*paths): """Return a path relative to test/fixtures. """ return os.path.join(os.path.dirname(__file__), 'fixtures', *paths) + class GitConfigUnitTest(unittest.TestCase): """Tests the GitConfig class. """ + def setUp(self): """Create a GitConfig object using the test.gitconfig fixture. """ @@ -68,5 +71,6 @@ class GitConfigUnitTest(unittest.TestCase): val = config.GetString('empty') self.assertEqual(val, None) + if __name__ == '__main__': unittest.main() diff --git a/tests/test_wrapper.py b/tests/test_wrapper.py index 8ef8d48d..38def512 100644 --- a/tests/test_wrapper.py +++ b/tests/test_wrapper.py @@ -23,14 +23,17 @@ import unittest import wrapper + def fixture(*paths): """Return a path relative to tests/fixtures. """ return os.path.join(os.path.dirname(__file__), 'fixtures', *paths) + class RepoWrapperUnitTest(unittest.TestCase): """Tests helper functions in the repo wrapper """ + def setUp(self): """Load the wrapper module every time """ @@ -76,5 +79,6 @@ class RepoWrapperUnitTest(unittest.TestCase): self.assertEqual(self.wrapper.gitc_parse_clientdir('/gitc/manifest-rw/'), None) self.assertEqual(self.wrapper.gitc_parse_clientdir('/test/usr/local/google/gitc/'), None) + if __name__ == '__main__': unittest.main() -- cgit v1.2.3-54-g00ecf