Mercurial > hgsubversion
changeset 833:312b37bc5e20
tests: avoid shadowing Python builtin all()
author | Yonggang Luo <luoyonggang@gmail.com> |
---|---|
date | Wed, 12 Oct 2011 15:43:31 +0800 |
parents | e9af7eba88db |
children | 27a2136e89cd |
files | tests/comprehensive/test_stupid_pull.py tests/comprehensive/test_verify.py tests/run.py tests/test_binaryfiles.py tests/test_diff.py tests/test_externals.py tests/test_fetch_branches.py tests/test_fetch_command.py tests/test_fetch_exec.py tests/test_fetch_mappings.py tests/test_fetch_renames.py tests/test_fetch_symlinks.py tests/test_fetch_truncated.py tests/test_push_dirs.py tests/test_push_eol.py tests/test_push_renames.py tests/test_rebuildmeta.py tests/test_single_dir_clone.py tests/test_startrev.py tests/test_svnwrap.py tests/test_template_keywords.py tests/test_unaffected_core.py tests/test_urls.py tests/test_utility_commands.py |
diffstat | 24 files changed, 50 insertions(+), 50 deletions(-) [+] |
line wrap: on
line diff
--- a/tests/comprehensive/test_stupid_pull.py +++ b/tests/comprehensive/test_stupid_pull.py @@ -56,6 +56,6 @@ StupidPullTests = type('StupidPullTests' def suite(): - all = [unittest.TestLoader().loadTestsFromTestCase(StupidPullTests), + all_tests = [unittest.TestLoader().loadTestsFromTestCase(StupidPullTests), ] - return unittest.TestSuite(all) + return unittest.TestSuite(all_tests)
--- a/tests/comprehensive/test_verify.py +++ b/tests/comprehensive/test_verify.py @@ -51,5 +51,5 @@ for case in fixtures: VerifyTests = type('VerifyTests', (test_util.TestBase,), attrs) def suite(): - all = [unittest.TestLoader().loadTestsFromTestCase(VerifyTests)] - return unittest.TestSuite(all) + all_tests = [unittest.TestLoader().loadTestsFromTestCase(VerifyTests)] + return unittest.TestSuite(all_tests)
--- a/tests/run.py +++ b/tests/run.py @@ -93,23 +93,23 @@ if __name__ == '__main__': import tempfile sys.stdout = tempfile.TemporaryFile() - all = tests() + all_tests = tests() args = [i.split('.py')[0].replace('-', '_') for i in args] if not args: check = lambda x: options.comprehensive or not comprehensive(x) - mods = [m for (n, m) in sorted(all.iteritems()) if check(m)] + mods = [m for (n, m) in sorted(all_tests.iteritems()) if check(m)] suite = [m.suite() for m in mods] else: suite = [] for arg in args: if arg == 'test_util': continue - elif arg not in all: + elif arg not in all_tests: print >> sys.stderr, 'test module %s not available' % arg else: - suite.append(all[arg].suite()) + suite.append(all_tests[arg].suite()) runner = unittest.TextTestRunner(**testargs) result = runner.run(unittest.TestSuite(suite))
--- a/tests/test_binaryfiles.py +++ b/tests/test_binaryfiles.py @@ -11,6 +11,6 @@ class TestFetchBinaryFiles(test_util.Tes self.test_binaryfiles(True) def suite(): - all = [unittest.TestLoader().loadTestsFromTestCase(TestFetchBinaryFiles), + all_tests = [unittest.TestLoader().loadTestsFromTestCase(TestFetchBinaryFiles), ] - return unittest.TestSuite(all) + return unittest.TestSuite(all_tests)
--- a/tests/test_diff.py +++ b/tests/test_diff.py @@ -38,6 +38,6 @@ class DiffTests(test_util.TestBase): def suite(): - all = [unittest.TestLoader().loadTestsFromTestCase(DiffTests), + all_tests = [unittest.TestLoader().loadTestsFromTestCase(DiffTests), ] - return unittest.TestSuite(all) + return unittest.TestSuite(all_tests)
--- a/tests/test_externals.py +++ b/tests/test_externals.py @@ -408,7 +408,7 @@ HEAD subdir1/deps/project1 self.assertchanges(changes, self.repo['tip']) def suite(): - all = [unittest.TestLoader().loadTestsFromTestCase(TestFetchExternals), + all_tests = [unittest.TestLoader().loadTestsFromTestCase(TestFetchExternals), unittest.TestLoader().loadTestsFromTestCase(TestPushExternals), ] - return unittest.TestSuite(all) + return unittest.TestSuite(all_tests)
--- a/tests/test_fetch_branches.py +++ b/tests/test_fetch_branches.py @@ -163,6 +163,6 @@ class TestFetchBranches(test_util.TestBa self.test_replace_branch_with_branch(True) def suite(): - all = [unittest.TestLoader().loadTestsFromTestCase(TestFetchBranches), + all_tests = [unittest.TestLoader().loadTestsFromTestCase(TestFetchBranches), ] - return unittest.TestSuite(all) + return unittest.TestSuite(all_tests)
--- a/tests/test_fetch_command.py +++ b/tests/test_fetch_command.py @@ -224,7 +224,7 @@ class TestStupidPull(test_util.TestBase) '1a6c3f30911d57abb67c257ec0df3e7bc44786f7') def suite(): - all = [unittest.TestLoader().loadTestsFromTestCase(TestBasicRepoLayout), + all_tests = [unittest.TestLoader().loadTestsFromTestCase(TestBasicRepoLayout), unittest.TestLoader().loadTestsFromTestCase(TestStupidPull), ] - return unittest.TestSuite(all) + return unittest.TestSuite(all_tests)
--- a/tests/test_fetch_exec.py +++ b/tests/test_fetch_exec.py @@ -33,6 +33,6 @@ class TestFetchExec(test_util.TestBase): self.test_empty_prop_val_executable(True) def suite(): - all = [unittest.TestLoader().loadTestsFromTestCase(TestFetchExec), + all_tests = [unittest.TestLoader().loadTestsFromTestCase(TestFetchExec), ] - return unittest.TestSuite(all) + return unittest.TestSuite(all_tests)
--- a/tests/test_fetch_mappings.py +++ b/tests/test_fetch_mappings.py @@ -96,8 +96,8 @@ class MapTests(test_util.TestBase): test = maps.AuthorMap(self.ui(), self.authors) fromself = set(test) test.load(orig) - all = set(test) - self.assertEqual(fromself.symmetric_difference(all), set()) + all_tests = set(test) + self.assertEqual(fromself.symmetric_difference(all_tests), set()) def test_file_map(self, stupid=False): test_util.load_svndump_fixture(self.repo_path, 'replace_trunk_with_branch.svndump')
--- a/tests/test_fetch_renames.py +++ b/tests/test_fetch_renames.py @@ -75,6 +75,6 @@ class TestFetchRenames(test_util.TestBas self._test_case(True) def suite(): - all = [unittest.TestLoader().loadTestsFromTestCase(TestFetchRenames), + all_tests = [unittest.TestLoader().loadTestsFromTestCase(TestFetchRenames), ] - return unittest.TestSuite(all) + return unittest.TestSuite(all_tests)
--- a/tests/test_fetch_symlinks.py +++ b/tests/test_fetch_symlinks.py @@ -53,6 +53,6 @@ class TestFetchSymlinks(test_util.TestBa self.test_symlinks(True) def suite(): - all = [unittest.TestLoader().loadTestsFromTestCase(TestFetchSymlinks), + all_tests = [unittest.TestLoader().loadTestsFromTestCase(TestFetchSymlinks), ] - return unittest.TestSuite(all) + return unittest.TestSuite(all_tests)
--- a/tests/test_fetch_truncated.py +++ b/tests/test_fetch_truncated.py @@ -31,6 +31,6 @@ class TestFetchTruncatedHistory(test_uti self.test_truncated_history(True) def suite(): - all = [unittest.TestLoader().loadTestsFromTestCase(TestFetchTruncatedHistory), + all_tests = [unittest.TestLoader().loadTestsFromTestCase(TestFetchTruncatedHistory), ] - return unittest.TestSuite(all) + return unittest.TestSuite(all_tests)
--- a/tests/test_push_dirs.py +++ b/tests/test_push_dirs.py @@ -105,6 +105,6 @@ class TestPushDirectories(test_util.Test 'tag_r3/new']) def suite(): - all = [unittest.TestLoader().loadTestsFromTestCase(TestPushDirectories), + all_tests = [unittest.TestLoader().loadTestsFromTestCase(TestPushDirectories), ] - return unittest.TestSuite(all) + return unittest.TestSuite(all_tests)
--- a/tests/test_push_eol.py +++ b/tests/test_push_eol.py @@ -37,6 +37,6 @@ class TestPushEol(test_util.TestBase): self._test_push_dirs(True) def suite(): - all = [unittest.TestLoader().loadTestsFromTestCase(TestPushEol), + all_tests = [unittest.TestLoader().loadTestsFromTestCase(TestPushEol), ] - return unittest.TestSuite(all) + return unittest.TestSuite(all_tests)
--- a/tests/test_push_renames.py +++ b/tests/test_push_renames.py @@ -119,6 +119,6 @@ class TestPushRenames(test_util.TestBase def suite(): - all = [unittest.TestLoader().loadTestsFromTestCase(TestPushRenames), + all_tests = [unittest.TestLoader().loadTestsFromTestCase(TestPushRenames), ] - return unittest.TestSuite(all) + return unittest.TestSuite(all_tests)
--- a/tests/test_rebuildmeta.py +++ b/tests/test_rebuildmeta.py @@ -117,6 +117,6 @@ RebuildMetaTests = type('RebuildMetaTest def suite(): - all = [unittest.TestLoader().loadTestsFromTestCase(RebuildMetaTests), + all_tests = [unittest.TestLoader().loadTestsFromTestCase(RebuildMetaTests), ] - return unittest.TestSuite(all) + return unittest.TestSuite(all_tests)
--- a/tests/test_single_dir_clone.py +++ b/tests/test_single_dir_clone.py @@ -266,5 +266,5 @@ class TestSingleDir(test_util.TestBase): self.test_push_single_dir_renamed_branch(True) def suite(): - all = [unittest.TestLoader().loadTestsFromTestCase(TestSingleDir)] - return unittest.TestSuite(all) + all_tests = [unittest.TestLoader().loadTestsFromTestCase(TestSingleDir)] + return unittest.TestSuite(all_tests)
--- a/tests/test_startrev.py +++ b/tests/test_startrev.py @@ -65,6 +65,6 @@ StartRevTests = type('StartRevTests', (t def suite(): - all = [unittest.TestLoader().loadTestsFromTestCase(StartRevTests), + all_tests = [unittest.TestLoader().loadTestsFromTestCase(StartRevTests), ] - return unittest.TestSuite(all) + return unittest.TestSuite(all_tests)
--- a/tests/test_svnwrap.py +++ b/tests/test_svnwrap.py @@ -71,6 +71,6 @@ class TestRootAsSubdirOfRepo(TestBasicRe )) def suite(): - all = [unittest.TestLoader().loadTestsFromTestCase(TestBasicRepoLayout), + all_tests = [unittest.TestLoader().loadTestsFromTestCase(TestBasicRepoLayout), unittest.TestLoader().loadTestsFromTestCase(TestRootAsSubdirOfRepo)] - return unittest.TestSuite(all) + return unittest.TestSuite(all_tests)
--- a/tests/test_template_keywords.py +++ b/tests/test_template_keywords.py @@ -82,5 +82,5 @@ class TestLogKeywords(test_util.TestBase template='{rev}:{svnrev} ', **defaults) def suite(): - all = [unittest.TestLoader().loadTestsFromTestCase(TestLogKeywords), ] - return unittest.TestSuite(all) + all_tests = [unittest.TestLoader().loadTestsFromTestCase(TestLogKeywords), ] + return unittest.TestSuite(all_tests)
--- a/tests/test_unaffected_core.py +++ b/tests/test_unaffected_core.py @@ -88,5 +88,5 @@ class TestMercurialCore(test_util.TestBa self.assertEqual(repo[branch].hex(), repo2['.'].hex()) def suite(): - all = [unittest.TestLoader().loadTestsFromTestCase(TestMercurialCore)] - return unittest.TestSuite(all) + all_tests = [unittest.TestLoader().loadTestsFromTestCase(TestMercurialCore)] + return unittest.TestSuite(all_tests)
--- a/tests/test_urls.py +++ b/tests/test_urls.py @@ -75,5 +75,5 @@ class TestSubversionUrls(test_util.TestB self.assertEqual(repo1.svnurl, repo2.svnurl) def suite(): - all = [unittest.TestLoader().loadTestsFromTestCase(TestSubversionUrls)] - return unittest.TestSuite(all) + all_tests = [unittest.TestLoader().loadTestsFromTestCase(TestSubversionUrls)] + return unittest.TestSuite(all_tests)
--- a/tests/test_utility_commands.py +++ b/tests/test_utility_commands.py @@ -251,6 +251,6 @@ class UtilityTests(test_util.TestBase): def suite(): - all = [unittest.TestLoader().loadTestsFromTestCase(UtilityTests), + all_tests = [unittest.TestLoader().loadTestsFromTestCase(UtilityTests), ] - return unittest.TestSuite(all) + return unittest.TestSuite(all_tests)