id summary reporter owner description type status priority milestone component version severity resolution keywords cc branch changelog apichanges internalchanges 11506 Tests can't be run using `-m` flag to `python setup.py test` Ryan J Ollos Ryan J Ollos "There are several ways to run the unit tests in a module: {{{#!sh $ python ./tracopt/versioncontrol/git/tests/__init__.py ........................ ---------------------------------------------------------------------- Ran 24 tests in 1.520s OK }}} {{{#!sh $ python -m tracopt.versioncontrol.git.tests.__init__ ........................ ---------------------------------------------------------------------- Ran 24 tests in 1.494s OK }}} {{{#!sh $ python setup.py test -m tracopt.versioncontrol.git.tests.__init__ running test running egg_info unrecognized .svn/entries format; skipping . writing requirements to Trac.egg-info/requires.txt writing Trac.egg-info/PKG-INFO writing top-level names to Trac.egg-info/top_level.txt writing dependency_links to Trac.egg-info/dependency_links.txt writing entry points to Trac.egg-info/entry_points.txt unrecognized .svn/entries format in /home/user/Workspace/t11500/teo-rjollos.git reading manifest file 'Trac.egg-info/SOURCES.txt' writing manifest file 'Trac.egg-info/SOURCES.txt' running build_ext test_git_version (tracopt.versioncontrol.git.tests.PyGIT.GitTestCase) ... ok test_is_sha (tracopt.versioncontrol.git.tests.PyGIT.GitTestCase) ... ok test_parse (tracopt.versioncontrol.git.tests.PyGIT.TestParseCommit) ... ok test_control_files_detection (tracopt.versioncontrol.git.tests.PyGIT.NormalTestCase) ... ok test_get_branches_with_cr_in_commitlog (tracopt.versioncontrol.git.tests.PyGIT.NormalTestCase) ... ok test_node_get_history_with_empty_commit (tracopt.versioncontrol.git.tests.PyGIT.NormalTestCase) ... ok test_rev_is_anchestor_of (tracopt.versioncontrol.git.tests.PyGIT.NormalTestCase) ... ok test_sync_after_removing_branch (tracopt.versioncontrol.git.tests.PyGIT.NormalTestCase) ... ok test_turn_off_persistent_cache (tracopt.versioncontrol.git.tests.PyGIT.NormalTestCase) ... ok test_get_historian (tracopt.versioncontrol.git.tests.PyGIT.UnicodeNameTestCase) ... ok test_ls_tree (tracopt.versioncontrol.git.tests.PyGIT.UnicodeNameTestCase) ... ok test_unicode_branches (tracopt.versioncontrol.git.tests.PyGIT.UnicodeNameTestCase) ... ok test_unicode_filename (tracopt.versioncontrol.git.tests.PyGIT.UnicodeNameTestCase) ... ok test_unicode_tags (tracopt.versioncontrol.git.tests.PyGIT.UnicodeNameTestCase) ... ok test_unicode_verifyrev (tracopt.versioncontrol.git.tests.PyGIT.UnicodeNameTestCase) ... ok test_bare (tracopt.versioncontrol.git.tests.git_fs.SanityCheckingTestCase) ... ok test_no_head_file (tracopt.versioncontrol.git.tests.git_fs.SanityCheckingTestCase) ... ok test_no_objects_dir (tracopt.versioncontrol.git.tests.git_fs.SanityCheckingTestCase) ... ok test_no_refs_dir (tracopt.versioncontrol.git.tests.git_fs.SanityCheckingTestCase) ... ok test_non_bare (tracopt.versioncontrol.git.tests.git_fs.SanityCheckingTestCase) ... ok test_non_persistent (tracopt.versioncontrol.git.tests.git_fs.PersistentCacheTestCase) ... ok test_persistent (tracopt.versioncontrol.git.tests.git_fs.PersistentCacheTestCase) ... ok test_with_cache (tracopt.versioncontrol.git.tests.git_fs.HistoryTimeRangeTestCase) ... ok test_without_cache (tracopt.versioncontrol.git.tests.git_fs.HistoryTimeRangeTestCase) ... ok ---------------------------------------------------------------------- Ran 24 tests in 1.684s OK Exception TypeError: TypeError(""'NoneType' object is not callable"",) in > ignored Exception TypeError: TypeError(""'NoneType' object is not callable"",) in > ignored }}} The last example provides the most verbose output, which was useful in debugging the issue in #11505. However, that doesn't actually work without this change: {{{#!diff diff --git a/tracopt/versioncontrol/git/tests/__init__.py b/tracopt/versioncontr index 0e6f8d0..0368ed0 100644 --- a/tracopt/versioncontrol/git/tests/__init__.py +++ b/tracopt/versioncontrol/git/tests/__init__.py @@ -16,7 +16,7 @@ import unittest from tracopt.versioncontrol.git.tests import PyGIT, git_fs -def suite(): +def test_suite(): suite = unittest.TestSuite() suite.addTest(PyGIT.suite()) suite.addTest(git_fs.suite()) @@ -24,4 +24,4 @@ def suite(): if __name__ == '__main__': - unittest.main(defaultTest='suite') + unittest.main(defaultTest='test_suite') }}} I haven't investigate yet whether that is a proper solution for this issue, or if there is some other change we could make." defect closed normal 1.2 general normal fixed unit tests olemis+trac@… Replaced `suite` function in test modules with `test_suite`.