summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSoonKyu Park <sk7.park@samsung.com>2016-04-11 16:35:26 +0900
committerSoonKyu Park <sk7.park@samsung.com>2016-04-11 16:35:26 +0900
commit4cd7d081275587835515bc22682f676fea864e81 (patch)
treeb49279a13b3a0b41bcca18f4484a47ded69fc046
parent8b9cd7463d1b86596ec1fe8bb6c8c83720919938 (diff)
parent0a5114f8292ee2aa0ea647830efd0b54fd753fd5 (diff)
downloadpython-nose-devel_psk_20160727.tar.gz
python-nose-devel_psk_20160727.tar.bz2
python-nose-devel_psk_20160727.zip
Change-Id: Icf86c49016177c41bc571c88a1f78f8238d698e2
-rw-r--r--distribute_setup.py485
-rw-r--r--doc/rtd-requirements.txt3
-rw-r--r--functional_tests/doc_tests/test_addplugins/support/test.pycbin0 -> 352 bytes
-rw-r--r--functional_tests/doc_tests/test_allmodules/support/mod.pycbin0 -> 601 bytes
-rw-r--r--functional_tests/doc_tests/test_allmodules/support/test.pycbin0 -> 352 bytes
-rw-r--r--functional_tests/doc_tests/test_coverage_html/coverage_html_fixtures.pycbin0 -> 1233 bytes
-rw-r--r--functional_tests/doc_tests/test_coverage_html/support/blah.pycbin0 -> 402 bytes
-rw-r--r--functional_tests/doc_tests/test_coverage_html/support/tests/test_covered.pycbin0 -> 337 bytes
-rw-r--r--functional_tests/doc_tests/test_doctest_fixtures/doctest_fixtures_fixtures.pycbin0 -> 1234 bytes
-rw-r--r--functional_tests/doc_tests/test_init_plugin/example.cfg3
-rw-r--r--functional_tests/doc_tests/test_init_plugin/init_plugin.rst.py3.patch10
-rw-r--r--functional_tests/doc_tests/test_issue089/support/unwanted_package/__init__.pycbin0 -> 193 bytes
-rw-r--r--functional_tests/doc_tests/test_issue089/support/unwanted_package/test_spam.pycbin0 -> 439 bytes
-rw-r--r--functional_tests/doc_tests/test_issue089/support/wanted_package/__init__.pycbin0 -> 191 bytes
-rw-r--r--functional_tests/doc_tests/test_issue089/support/wanted_package/test_eggs.pycbin0 -> 435 bytes
-rw-r--r--functional_tests/doc_tests/test_issue107/support/test_spam.pycbin0 -> 593 bytes
-rw-r--r--functional_tests/doc_tests/test_issue119/test_zeronine.pycbin0 -> 1560 bytes
-rw-r--r--functional_tests/doc_tests/test_issue142/support/errorclass_failing_test.pycbin0 -> 690 bytes
-rw-r--r--functional_tests/doc_tests/test_issue142/support/errorclass_failure_plugin.pycbin0 -> 1248 bytes
-rw-r--r--functional_tests/doc_tests/test_issue142/support/errorclass_tests.pycbin0 -> 1628 bytes
-rw-r--r--functional_tests/doc_tests/test_issue145/support/package1/__init__.pycbin0 -> 399 bytes
-rw-r--r--functional_tests/doc_tests/test_issue145/support/package1/test_module.pycbin0 -> 1307 bytes
-rw-r--r--functional_tests/doc_tests/test_issue145/support/package2c/__init__.pycbin0 -> 402 bytes
-rw-r--r--functional_tests/doc_tests/test_issue145/support/package2c/test_module.pycbin0 -> 283 bytes
-rw-r--r--functional_tests/doc_tests/test_issue145/support/package2f/__init__.pycbin0 -> 402 bytes
-rw-r--r--functional_tests/doc_tests/test_issue145/support/package2f/test_module.pycbin0 -> 263 bytes
-rw-r--r--functional_tests/doc_tests/test_multiprocess/multiprocess_fixtures.pycbin0 -> 850 bytes
-rw-r--r--functional_tests/doc_tests/test_multiprocess/support/test_can_split.pycbin0 -> 2128 bytes
-rw-r--r--functional_tests/doc_tests/test_multiprocess/support/test_not_shared.pycbin0 -> 2126 bytes
-rw-r--r--functional_tests/doc_tests/test_multiprocess/support/test_shared.pycbin0 -> 3050 bytes
-rw-r--r--functional_tests/doc_tests/test_restricted_plugin_options/restricted_plugin_options.rst.py3.patch9
-rw-r--r--functional_tests/doc_tests/test_restricted_plugin_options/support/test.pycbin0 -> 382 bytes
-rw-r--r--functional_tests/doc_tests/test_selector_plugin/support/mymodule.pycbin0 -> 407 bytes
-rw-r--r--functional_tests/doc_tests/test_selector_plugin/support/mypackage/__init__.pycbin0 -> 193 bytes
-rw-r--r--functional_tests/doc_tests/test_selector_plugin/support/mypackage/math/__init__.pycbin0 -> 249 bytes
-rw-r--r--functional_tests/doc_tests/test_selector_plugin/support/mypackage/math/basic.pycbin0 -> 623 bytes
-rw-r--r--functional_tests/doc_tests/test_selector_plugin/support/mypackage/strings.pycbin0 -> 418 bytes
-rw-r--r--functional_tests/doc_tests/test_selector_plugin/support/tests/math/basic.pycbin0 -> 1609 bytes
-rw-r--r--functional_tests/doc_tests/test_selector_plugin/support/tests/mymodule/my_function.pycbin0 -> 862 bytes
-rw-r--r--functional_tests/doc_tests/test_selector_plugin/support/tests/strings/cat.pycbin0 -> 1129 bytes
-rw-r--r--functional_tests/doc_tests/test_selector_plugin/support/tests/testlib.pycbin0 -> 541 bytes
-rw-r--r--functional_tests/doc_tests/test_xunit_plugin/support/nosetests.xml25
-rw-r--r--functional_tests/doc_tests/test_xunit_plugin/support/test_skip.pycbin0 -> 1121 bytes
-rw-r--r--functional_tests/support/att/test_attr.pycbin0 -> 5486 bytes
-rw-r--r--functional_tests/support/coverage/blah.py6
-rw-r--r--functional_tests/support/coverage/blah.pycbin0 -> 519 bytes
-rw-r--r--functional_tests/support/coverage/tests/test_covered.py4
-rw-r--r--functional_tests/support/coverage/tests/test_covered.pycbin0 -> 406 bytes
-rw-r--r--functional_tests/support/coverage2/blah.py6
-rw-r--r--functional_tests/support/coverage2/moo.py2
-rw-r--r--functional_tests/support/coverage2/moo.pycbin0 -> 334 bytes
-rw-r--r--functional_tests/support/coverage2/tests/test_covered.py8
-rw-r--r--functional_tests/support/coverage2/tests/test_covered.pycbin0 -> 632 bytes
-rw-r--r--functional_tests/support/ctx/mod_import_skip.pycbin0 -> 705 bytes
-rw-r--r--functional_tests/support/ctx/mod_setup_fails.pycbin0 -> 831 bytes
-rw-r--r--functional_tests/support/ctx/mod_setup_skip.pycbin0 -> 855 bytes
-rw-r--r--functional_tests/support/dir1/mod.pycbin0 -> 152 bytes
-rw-r--r--functional_tests/support/dir1/pak/__init__.pycbin0 -> 161 bytes
-rw-r--r--functional_tests/support/dir1/pak/mod.pycbin0 -> 156 bytes
-rw-r--r--functional_tests/support/dir1/pak/sub/__init__.pycbin0 -> 165 bytes
-rw-r--r--functional_tests/support/dir2/mod.pycbin0 -> 152 bytes
-rw-r--r--functional_tests/support/dir2/pak/__init__.pycbin0 -> 161 bytes
-rw-r--r--functional_tests/support/dir2/pak/mod.pycbin0 -> 156 bytes
-rw-r--r--functional_tests/support/dir2/pak/sub/__init__.pycbin0 -> 165 bytes
-rw-r--r--functional_tests/support/dtt/some_mod.pycbin0 -> 467 bytes
-rw-r--r--functional_tests/support/fdp/test_fdp.pycbin0 -> 794 bytes
-rw-r--r--functional_tests/support/fdp/test_fdp_no_capt.pycbin0 -> 809 bytes
-rw-r--r--functional_tests/support/gen/test.pycbin0 -> 753 bytes
-rw-r--r--functional_tests/support/id_fails/test_a.pycbin0 -> 204 bytes
-rw-r--r--functional_tests/support/id_fails/test_b.pycbin0 -> 535 bytes
-rw-r--r--functional_tests/support/idp/exm.pycbin0 -> 531 bytes
-rw-r--r--functional_tests/support/idp/tests.pycbin0 -> 2603 bytes
-rw-r--r--functional_tests/support/ipt/test1/ipthelp.pycbin0 -> 376 bytes
-rw-r--r--functional_tests/support/ipt/test1/tests.pycbin0 -> 455 bytes
-rw-r--r--functional_tests/support/ipt/test2/ipthelp.pycbin0 -> 397 bytes
-rw-r--r--functional_tests/support/ipt/test2/tests.pycbin0 -> 463 bytes
-rw-r--r--functional_tests/support/issue038/test.pycbin0 -> 590 bytes
-rw-r--r--functional_tests/support/issue072/test.pycbin0 -> 400 bytes
-rw-r--r--functional_tests/support/issue082/mypublicpackage/__init__.pycbin0 -> 177 bytes
-rw-r--r--functional_tests/support/issue082/mypublicpackage/_foo.pycbin0 -> 214 bytes
-rw-r--r--functional_tests/support/issue082/mypublicpackage/bar.pycbin0 -> 213 bytes
-rw-r--r--functional_tests/support/issue130/test.pycbin0 -> 545 bytes
-rw-r--r--functional_tests/support/issue191/UNKNOWN.egg-info/PKG-INFO10
-rw-r--r--functional_tests/support/issue191/UNKNOWN.egg-info/SOURCES.txt6
-rw-r--r--functional_tests/support/issue191/UNKNOWN.egg-info/dependency_links.txt1
-rw-r--r--functional_tests/support/issue191/UNKNOWN.egg-info/top_level.txt1
-rw-r--r--functional_tests/support/issue191/test.pycbin0 -> 318 bytes
-rw-r--r--functional_tests/support/issue269/test_bad_class.pycbin0 -> 809 bytes
-rw-r--r--functional_tests/support/issue279/test_mod_setup_fails.pycbin0 -> 622 bytes
-rw-r--r--functional_tests/support/issue408/nosetests.xml0
-rw-r--r--functional_tests/support/issue408/test.py16
-rw-r--r--functional_tests/support/issue408/test.pycbin0 -> 1591 bytes
-rw-r--r--functional_tests/support/ltfn/state.pycbin0 -> 171 bytes
-rw-r--r--functional_tests/support/ltfn/test_mod.pycbin0 -> 845 bytes
-rw-r--r--functional_tests/support/ltfn/test_pak1/__init__.pycbin0 -> 1127 bytes
-rw-r--r--functional_tests/support/ltfn/test_pak1/test_mod.pycbin0 -> 933 bytes
-rw-r--r--functional_tests/support/ltfn/test_pak2/__init__.pycbin0 -> 1127 bytes
-rw-r--r--functional_tests/support/ltftc/tests.pycbin0 -> 822 bytes
-rw-r--r--functional_tests/support/namespace_pkg/namespace_pkg/__init__.pycbin0 -> 271 bytes
-rw-r--r--functional_tests/support/namespace_pkg/namespace_pkg/example.pycbin0 -> 213 bytes
-rw-r--r--functional_tests/support/namespace_pkg/namespace_pkg/test_pkg.pycbin0 -> 609 bytes
-rw-r--r--functional_tests/support/namespace_pkg/site-packages/namespace_pkg/example2.pycbin0 -> 235 bytes
-rw-r--r--functional_tests/support/namespace_pkg/site-packages/namespace_pkg/test_pkg2.pycbin0 -> 640 bytes
-rw-r--r--functional_tests/support/package1/example.pycbin0 -> 416 bytes
-rw-r--r--functional_tests/support/package1/tests/test_example_function.pycbin0 -> 1503 bytes
-rw-r--r--functional_tests/support/package2/maths.pycbin0 -> 869 bytes
-rw-r--r--functional_tests/support/package2/test_pak/__init__.pycbin0 -> 669 bytes
-rw-r--r--functional_tests/support/package2/test_pak/test_mod.pycbin0 -> 1446 bytes
-rw-r--r--functional_tests/support/package2/test_pak/test_sub/__init__.pycbin0 -> 719 bytes
-rw-r--r--functional_tests/support/package2/test_pak/test_sub/test_mod.pycbin0 -> 3157 bytes
-rw-r--r--functional_tests/support/package3/lib/a.pycbin0 -> 317 bytes
-rw-r--r--functional_tests/support/package3/src/b.pycbin0 -> 317 bytes
-rw-r--r--functional_tests/support/package3/tests/test_a.pycbin0 -> 376 bytes
-rw-r--r--functional_tests/support/package3/tests/test_b.pycbin0 -> 376 bytes
-rw-r--r--functional_tests/support/pass/test.pycbin0 -> 310 bytes
-rw-r--r--functional_tests/support/test_buggy_generators.pycbin0 -> 2399 bytes
-rw-r--r--functional_tests/support/todo/test_with_todo.pycbin0 -> 624 bytes
-rw-r--r--functional_tests/support/todo/todoplug.pycbin0 -> 774 bytes
-rw-r--r--functional_tests/support/twist/test_twisted.pycbin0 -> 1301 bytes
-rw-r--r--functional_tests/support/xunit.xml24
-rw-r--r--functional_tests/support/xunit/test_xunit_as_suite.pycbin0 -> 1883 bytes
-rw-r--r--functional_tests/test_attribute_plugin.pycbin0 -> 9500 bytes
-rw-r--r--functional_tests/test_buggy_generators.pycbin0 -> 2034 bytes
-rw-r--r--functional_tests/test_cases.pycbin0 -> 2467 bytes
-rw-r--r--functional_tests/test_collector.pycbin0 -> 2148 bytes
-rw-r--r--functional_tests/test_commands.pycbin0 -> 2155 bytes
-rw-r--r--functional_tests/test_config_files.pycbin0 -> 2161 bytes
-rw-r--r--functional_tests/test_coverage_plugin.py78
-rw-r--r--functional_tests/test_coverage_plugin.pycbin0 -> 4079 bytes
-rw-r--r--functional_tests/test_defaultpluginmanager.py22
-rw-r--r--functional_tests/test_defaultpluginmanager.pycbin0 -> 1409 bytes
-rw-r--r--functional_tests/test_doctest_plugin.pycbin0 -> 2150 bytes
-rw-r--r--functional_tests/test_entrypoints.pycbin0 -> 950 bytes
-rw-r--r--functional_tests/test_failuredetail_plugin.pycbin0 -> 2001 bytes
-rw-r--r--functional_tests/test_generator_fixtures.pycbin0 -> 2918 bytes
-rw-r--r--functional_tests/test_id_plugin.pycbin0 -> 10626 bytes
-rw-r--r--functional_tests/test_importer.pycbin0 -> 6925 bytes
-rw-r--r--functional_tests/test_isolate_plugin.pycbin0 -> 2767 bytes
-rw-r--r--functional_tests/test_issue120/support/some_test.pycbin0 -> 343 bytes
-rw-r--r--functional_tests/test_issue_072.pycbin0 -> 2073 bytes
-rw-r--r--functional_tests/test_issue_082.pycbin0 -> 3382 bytes
-rw-r--r--functional_tests/test_issue_408.py25
-rw-r--r--functional_tests/test_issue_408.pycbin0 -> 1339 bytes
-rw-r--r--functional_tests/test_load_tests_from_test_case.pycbin0 -> 2972 bytes
-rw-r--r--functional_tests/test_loader.pycbin0 -> 18497 bytes
-rw-r--r--functional_tests/test_multiprocessing/__init__.py28
-rw-r--r--functional_tests/test_multiprocessing/__init__.pycbin0 -> 1681 bytes
-rw-r--r--functional_tests/test_multiprocessing/support/class.py14
-rw-r--r--functional_tests/test_multiprocessing/support/class.pycbin0 -> 1530 bytes
-rw-r--r--functional_tests/test_multiprocessing/support/concurrent_shared/__init__.py6
-rw-r--r--functional_tests/test_multiprocessing/support/concurrent_shared/__init__.pycbin0 -> 737 bytes
-rw-r--r--functional_tests/test_multiprocessing/support/concurrent_shared/test.py11
-rw-r--r--functional_tests/test_multiprocessing/support/concurrent_shared/test.pycbin0 -> 1158 bytes
-rw-r--r--functional_tests/test_multiprocessing/support/fake_nosetest.py14
-rw-r--r--functional_tests/test_multiprocessing/support/keyboardinterrupt.py29
-rw-r--r--functional_tests/test_multiprocessing/support/keyboardinterrupt.pycbin0 -> 1657 bytes
-rw-r--r--functional_tests/test_multiprocessing/support/keyboardinterrupt_twice.py34
-rw-r--r--functional_tests/test_multiprocessing/support/keyboardinterrupt_twice.pycbin0 -> 1824 bytes
-rw-r--r--functional_tests/test_multiprocessing/support/nameerror.py4
-rw-r--r--functional_tests/test_multiprocessing/support/nameerror.pycbin0 -> 201 bytes
-rw-r--r--functional_tests/test_multiprocessing/support/timeout.py12
-rw-r--r--functional_tests/test_multiprocessing/support/timeout.pycbin0 -> 841 bytes
-rw-r--r--functional_tests/test_multiprocessing/test_class.py13
-rw-r--r--functional_tests/test_multiprocessing/test_class.pycbin0 -> 944 bytes
-rw-r--r--functional_tests/test_multiprocessing/test_concurrent_shared.py13
-rw-r--r--functional_tests/test_multiprocessing/test_concurrent_shared.pycbin0 -> 1099 bytes
-rw-r--r--functional_tests/test_multiprocessing/test_keyboardinterrupt.py84
-rw-r--r--functional_tests/test_multiprocessing/test_keyboardinterrupt.pycbin0 -> 4177 bytes
-rw-r--r--functional_tests/test_multiprocessing/test_nameerror.py13
-rw-r--r--functional_tests/test_multiprocessing/test_nameerror.pycbin0 -> 1011 bytes
-rw-r--r--functional_tests/test_multiprocessing/test_process_timeout.py21
-rw-r--r--functional_tests/test_multiprocessing/test_process_timeout.pycbin0 -> 1702 bytes
-rw-r--r--functional_tests/test_namespace_pkg.pycbin0 -> 2756 bytes
-rw-r--r--functional_tests/test_plugin_api.pycbin0 -> 2298 bytes
-rw-r--r--functional_tests/test_plugins.pycbin0 -> 3271 bytes
-rw-r--r--functional_tests/test_plugintest.pycbin0 -> 3702 bytes
-rw-r--r--functional_tests/test_program.pycbin0 -> 6931 bytes
-rw-r--r--functional_tests/test_result.pycbin0 -> 1482 bytes
-rw-r--r--functional_tests/test_selector.pycbin0 -> 1101 bytes
-rw-r--r--functional_tests/test_skip_pdb_interaction.pycbin0 -> 2958 bytes
-rw-r--r--functional_tests/test_success.pycbin0 -> 1790 bytes
-rw-r--r--functional_tests/test_suite.pycbin0 -> 2355 bytes
-rw-r--r--functional_tests/test_xunit.pycbin0 -> 2957 bytes
-rw-r--r--nose/pyversion.py130
-rw-r--r--nose/tools/__init__.py11
-rw-r--r--nose/tools/nontrivial.py150
-rw-r--r--nose/tools/trivial.py54
-rw-r--r--patch.py639
-rw-r--r--setup3lib.py151
-rw-r--r--unit_tests/helpers.pycbin0 -> 385 bytes
-rw-r--r--unit_tests/mock.pycbin0 -> 6605 bytes
-rw-r--r--unit_tests/support/bug105/tests.pycbin0 -> 2536 bytes
-rw-r--r--unit_tests/support/doctest/err_doctests.pycbin0 -> 520 bytes
-rw-r--r--unit_tests/support/doctest/no_doctests.pycbin0 -> 466 bytes
-rw-r--r--unit_tests/support/foo/__init__.pycbin0 -> 394 bytes
-rw-r--r--unit_tests/support/foo/bar/__init__.pycbin0 -> 154 bytes
-rw-r--r--unit_tests/support/foo/bar/buz.pycbin0 -> 402 bytes
-rw-r--r--unit_tests/support/issue006/tests.pycbin0 -> 1555 bytes
-rw-r--r--unit_tests/support/issue065/tests.pycbin0 -> 594 bytes
-rw-r--r--unit_tests/support/issue270/__init__.pycbin0 -> 315 bytes
-rw-r--r--unit_tests/support/issue270/foo_test.pycbin0 -> 711 bytes
-rw-r--r--unit_tests/test_attribute_plugin.pycbin0 -> 2919 bytes
-rw-r--r--unit_tests/test_bug105.pycbin0 -> 1383 bytes
-rw-r--r--unit_tests/test_capture_plugin.pycbin0 -> 4129 bytes
-rw-r--r--unit_tests/test_cases.pycbin0 -> 14843 bytes
-rw-r--r--unit_tests/test_config.pycbin0 -> 6636 bytes
-rw-r--r--unit_tests/test_core.pycbin0 -> 4349 bytes
-rw-r--r--unit_tests/test_deprecated_plugin.pycbin0 -> 6165 bytes
-rw-r--r--unit_tests/test_doctest_error_handling.pycbin0 -> 2249 bytes
-rw-r--r--unit_tests/test_id_plugin.pycbin0 -> 1089 bytes
-rw-r--r--unit_tests/test_importer.pycbin0 -> 2493 bytes
-rw-r--r--unit_tests/test_inspector.pycbin0 -> 5352 bytes
-rw-r--r--unit_tests/test_isolation_plugin.pycbin0 -> 362 bytes
-rw-r--r--unit_tests/test_issue270_fixtures.pycbin0 -> 734 bytes
-rw-r--r--unit_tests/test_issue_006.pycbin0 -> 1540 bytes
-rw-r--r--unit_tests/test_issue_064.pycbin0 -> 410 bytes
-rw-r--r--unit_tests/test_issue_065.pycbin0 -> 1143 bytes
-rw-r--r--unit_tests/test_issue_100.rst.py3.patch8
-rw-r--r--unit_tests/test_issue_101.pycbin0 -> 1662 bytes
-rw-r--r--unit_tests/test_issue_227.pycbin0 -> 680 bytes
-rw-r--r--unit_tests/test_issue_230.pycbin0 -> 1233 bytes
-rw-r--r--unit_tests/test_lazy_suite.pycbin0 -> 1458 bytes
-rw-r--r--unit_tests/test_loader.pycbin0 -> 20830 bytes
-rw-r--r--unit_tests/test_logcapture_plugin.pycbin0 -> 9450 bytes
-rw-r--r--unit_tests/test_logging.pycbin0 -> 1752 bytes
-rw-r--r--unit_tests/test_multiprocess.pycbin0 -> 2793 bytes
-rw-r--r--unit_tests/test_multiprocess_runner.pycbin0 -> 6205 bytes
-rw-r--r--unit_tests/test_pdb_plugin.pycbin0 -> 4864 bytes
-rw-r--r--unit_tests/test_plugin.pycbin0 -> 1621 bytes
-rw-r--r--unit_tests/test_plugin_interfaces.pycbin0 -> 1914 bytes
-rw-r--r--unit_tests/test_plugin_manager.pycbin0 -> 5207 bytes
-rw-r--r--unit_tests/test_plugins.pycbin0 -> 16605 bytes
-rw-r--r--unit_tests/test_result_proxy.pycbin0 -> 9498 bytes
-rw-r--r--unit_tests/test_selector.pycbin0 -> 9127 bytes
-rw-r--r--unit_tests/test_selector_plugins.pycbin0 -> 1685 bytes
-rw-r--r--unit_tests/test_skip_plugin.pycbin0 -> 5946 bytes
-rw-r--r--unit_tests/test_suite.pycbin0 -> 12451 bytes
-rw-r--r--unit_tests/test_tools.pycbin0 -> 9156 bytes
-rw-r--r--unit_tests/test_twisted.pycbin0 -> 3562 bytes
-rw-r--r--unit_tests/test_twisted_testcase.pycbin0 -> 750 bytes
-rw-r--r--unit_tests/test_utils.pycbin0 -> 8894 bytes
-rw-r--r--unit_tests/test_xunit.pycbin0 -> 14095 bytes
242 files changed, 2183 insertions, 0 deletions
diff --git a/distribute_setup.py b/distribute_setup.py
new file mode 100644
index 0000000..3ea2e66
--- /dev/null
+++ b/distribute_setup.py
@@ -0,0 +1,485 @@
+#!python
+"""Bootstrap distribute installation
+
+If you want to use setuptools in your package's setup.py, just include this
+file in the same directory with it, and add this to the top of your setup.py::
+
+ from distribute_setup import use_setuptools
+ use_setuptools()
+
+If you want to require a specific version of setuptools, set a download
+mirror, or use an alternate download directory, you can do so by supplying
+the appropriate options to ``use_setuptools()``.
+
+This file can also be run as a script to install or upgrade setuptools.
+"""
+import os
+import sys
+import time
+import fnmatch
+import tempfile
+import tarfile
+from distutils import log
+
+try:
+ from site import USER_SITE
+except ImportError:
+ USER_SITE = None
+
+try:
+ import subprocess
+
+ def _python_cmd(*args):
+ args = (sys.executable,) + args
+ return subprocess.call(args) == 0
+
+except ImportError:
+ # will be used for python 2.3
+ def _python_cmd(*args):
+ args = (sys.executable,) + args
+ # quoting arguments if windows
+ if sys.platform == 'win32':
+ def quote(arg):
+ if ' ' in arg:
+ return '"%s"' % arg
+ return arg
+ args = [quote(arg) for arg in args]
+ return os.spawnl(os.P_WAIT, sys.executable, *args) == 0
+
+DEFAULT_VERSION = "0.6.14"
+DEFAULT_URL = "http://pypi.python.org/packages/source/d/distribute/"
+SETUPTOOLS_FAKED_VERSION = "0.6c11"
+
+SETUPTOOLS_PKG_INFO = """\
+Metadata-Version: 1.0
+Name: setuptools
+Version: %s
+Summary: xxxx
+Home-page: xxx
+Author: xxx
+Author-email: xxx
+License: xxx
+Description: xxx
+""" % SETUPTOOLS_FAKED_VERSION
+
+
+def _install(tarball):
+ # extracting the tarball
+ tmpdir = tempfile.mkdtemp()
+ log.warn('Extracting in %s', tmpdir)
+ old_wd = os.getcwd()
+ try:
+ os.chdir(tmpdir)
+ tar = tarfile.open(tarball)
+ _extractall(tar)
+ tar.close()
+
+ # going in the directory
+ subdir = os.path.join(tmpdir, os.listdir(tmpdir)[0])
+ os.chdir(subdir)
+ log.warn('Now working in %s', subdir)
+
+ # installing
+ log.warn('Installing Distribute')
+ if not _python_cmd('setup.py', 'install'):
+ log.warn('Something went wrong during the installation.')
+ log.warn('See the error message above.')
+ finally:
+ os.chdir(old_wd)
+
+
+def _build_egg(egg, tarball, to_dir):
+ # extracting the tarball
+ tmpdir = tempfile.mkdtemp()
+ log.warn('Extracting in %s', tmpdir)
+ old_wd = os.getcwd()
+ try:
+ os.chdir(tmpdir)
+ tar = tarfile.open(tarball)
+ _extractall(tar)
+ tar.close()
+
+ # going in the directory
+ subdir = os.path.join(tmpdir, os.listdir(tmpdir)[0])
+ os.chdir(subdir)
+ log.warn('Now working in %s', subdir)
+
+ # building an egg
+ log.warn('Building a Distribute egg in %s', to_dir)
+ _python_cmd('setup.py', '-q', 'bdist_egg', '--dist-dir', to_dir)
+
+ finally:
+ os.chdir(old_wd)
+ # returning the result
+ log.warn(egg)
+ if not os.path.exists(egg):
+ raise IOError('Could not build the egg.')
+
+
+def _do_download(version, download_base, to_dir, download_delay):
+ egg = os.path.join(to_dir, 'distribute-%s-py%d.%d.egg'
+ % (version, sys.version_info[0], sys.version_info[1]))
+ if not os.path.exists(egg):
+ tarball = download_setuptools(version, download_base,
+ to_dir, download_delay)
+ _build_egg(egg, tarball, to_dir)
+ sys.path.insert(0, egg)
+ import setuptools
+ setuptools.bootstrap_install_from = egg
+
+
+def use_setuptools(version=DEFAULT_VERSION, download_base=DEFAULT_URL,
+ to_dir=os.curdir, download_delay=15, no_fake=True):
+ # making sure we use the absolute path
+ to_dir = os.path.abspath(to_dir)
+ was_imported = 'pkg_resources' in sys.modules or \
+ 'setuptools' in sys.modules
+ try:
+ try:
+ import pkg_resources
+ if not hasattr(pkg_resources, '_distribute'):
+ if not no_fake:
+ _fake_setuptools()
+ raise ImportError
+ except ImportError:
+ return _do_download(version, download_base, to_dir, download_delay)
+ try:
+ pkg_resources.require("distribute>="+version)
+ return
+ except pkg_resources.VersionConflict:
+ e = sys.exc_info()[1]
+ if was_imported:
+ sys.stderr.write(
+ "The required version of distribute (>=%s) is not available,\n"
+ "and can't be installed while this script is running. Please\n"
+ "install a more recent version first, using\n"
+ "'easy_install -U distribute'."
+ "\n\n(Currently using %r)\n" % (version, e.args[0]))
+ sys.exit(2)
+ else:
+ del pkg_resources, sys.modules['pkg_resources'] # reload ok
+ return _do_download(version, download_base, to_dir,
+ download_delay)
+ except pkg_resources.DistributionNotFound:
+ return _do_download(version, download_base, to_dir,
+ download_delay)
+ finally:
+ if not no_fake:
+ _create_fake_setuptools_pkg_info(to_dir)
+
+def download_setuptools(version=DEFAULT_VERSION, download_base=DEFAULT_URL,
+ to_dir=os.curdir, delay=15):
+ """Download distribute from a specified location and return its filename
+
+ `version` should be a valid distribute version number that is available
+ as an egg for download under the `download_base` URL (which should end
+ with a '/'). `to_dir` is the directory where the egg will be downloaded.
+ `delay` is the number of seconds to pause before an actual download
+ attempt.
+ """
+ # making sure we use the absolute path
+ to_dir = os.path.abspath(to_dir)
+ try:
+ from urllib.request import urlopen
+ except ImportError:
+ from urllib2 import urlopen
+ tgz_name = "distribute-%s.tar.gz" % version
+ url = download_base + tgz_name
+ saveto = os.path.join(to_dir, tgz_name)
+ src = dst = None
+ if not os.path.exists(saveto): # Avoid repeated downloads
+ try:
+ log.warn("Downloading %s", url)
+ src = urlopen(url)
+ # Read/write all in one block, so we don't create a corrupt file
+ # if the download is interrupted.
+ data = src.read()
+ dst = open(saveto, "wb")
+ dst.write(data)
+ finally:
+ if src:
+ src.close()
+ if dst:
+ dst.close()
+ return os.path.realpath(saveto)
+
+def _no_sandbox(function):
+ def __no_sandbox(*args, **kw):
+ try:
+ from setuptools.sandbox import DirectorySandbox
+ if not hasattr(DirectorySandbox, '_old'):
+ def violation(*args):
+ pass
+ DirectorySandbox._old = DirectorySandbox._violation
+ DirectorySandbox._violation = violation
+ patched = True
+ else:
+ patched = False
+ except ImportError:
+ patched = False
+
+ try:
+ return function(*args, **kw)
+ finally:
+ if patched:
+ DirectorySandbox._violation = DirectorySandbox._old
+ del DirectorySandbox._old
+
+ return __no_sandbox
+
+def _patch_file(path, content):
+ """Will backup the file then patch it"""
+ existing_content = open(path).read()
+ if existing_content == content:
+ # already patched
+ log.warn('Already patched.')
+ return False
+ log.warn('Patching...')
+ _rename_path(path)
+ f = open(path, 'w')
+ try:
+ f.write(content)
+ finally:
+ f.close()
+ return True
+
+_patch_file = _no_sandbox(_patch_file)
+
+def _same_content(path, content):
+ return open(path).read() == content
+
+def _rename_path(path):
+ new_name = path + '.OLD.%s' % time.time()
+ log.warn('Renaming %s into %s', path, new_name)
+ os.rename(path, new_name)
+ return new_name
+
+def _remove_flat_installation(placeholder):
+ if not os.path.isdir(placeholder):
+ log.warn('Unkown installation at %s', placeholder)
+ return False
+ found = False
+ for file in os.listdir(placeholder):
+ if fnmatch.fnmatch(file, 'setuptools*.egg-info'):
+ found = True
+ break
+ if not found:
+ log.warn('Could not locate setuptools*.egg-info')
+ return
+
+ log.warn('Removing elements out of the way...')
+ pkg_info = os.path.join(placeholder, file)
+ if os.path.isdir(pkg_info):
+ patched = _patch_egg_dir(pkg_info)
+ else:
+ patched = _patch_file(pkg_info, SETUPTOOLS_PKG_INFO)
+
+ if not patched:
+ log.warn('%s already patched.', pkg_info)
+ return False
+ # now let's move the files out of the way
+ for element in ('setuptools', 'pkg_resources.py', 'site.py'):
+ element = os.path.join(placeholder, element)
+ if os.path.exists(element):
+ _rename_path(element)
+ else:
+ log.warn('Could not find the %s element of the '
+ 'Setuptools distribution', element)
+ return True
+
+_remove_flat_installation = _no_sandbox(_remove_flat_installation)
+
+def _after_install(dist):
+ log.warn('After install bootstrap.')
+ placeholder = dist.get_command_obj('install').install_purelib
+ _create_fake_setuptools_pkg_info(placeholder)
+
+def _create_fake_setuptools_pkg_info(placeholder):
+ if not placeholder or not os.path.exists(placeholder):
+ log.warn('Could not find the install location')
+ return
+ pyver = '%s.%s' % (sys.version_info[0], sys.version_info[1])
+ setuptools_file = 'setuptools-%s-py%s.egg-info' % \
+ (SETUPTOOLS_FAKED_VERSION, pyver)
+ pkg_info = os.path.join(placeholder, setuptools_file)
+ if os.path.exists(pkg_info):
+ log.warn('%s already exists', pkg_info)
+ return
+
+ log.warn('Creating %s', pkg_info)
+ f = open(pkg_info, 'w')
+ try:
+ f.write(SETUPTOOLS_PKG_INFO)
+ finally:
+ f.close()
+
+ pth_file = os.path.join(placeholder, 'setuptools.pth')
+ log.warn('Creating %s', pth_file)
+ f = open(pth_file, 'w')
+ try:
+ f.write(os.path.join(os.curdir, setuptools_file))
+ finally:
+ f.close()
+
+_create_fake_setuptools_pkg_info = _no_sandbox(_create_fake_setuptools_pkg_info)
+
+def _patch_egg_dir(path):
+ # let's check if it's already patched
+ pkg_info = os.path.join(path, 'EGG-INFO', 'PKG-INFO')
+ if os.path.exists(pkg_info):
+ if _same_content(pkg_info, SETUPTOOLS_PKG_INFO):
+ log.warn('%s already patched.', pkg_info)
+ return False
+ _rename_path(path)
+ os.mkdir(path)
+ os.mkdir(os.path.join(path, 'EGG-INFO'))
+ pkg_info = os.path.join(path, 'EGG-INFO', 'PKG-INFO')
+ f = open(pkg_info, 'w')
+ try:
+ f.write(SETUPTOOLS_PKG_INFO)
+ finally:
+ f.close()
+ return True
+
+_patch_egg_dir = _no_sandbox(_patch_egg_dir)
+
+def _before_install():
+ log.warn('Before install bootstrap.')
+ _fake_setuptools()
+
+
+def _under_prefix(location):
+ if 'install' not in sys.argv:
+ return True
+ args = sys.argv[sys.argv.index('install')+1:]
+ for index, arg in enumerate(args):
+ for option in ('--root', '--prefix'):
+ if arg.startswith('%s=' % option):
+ top_dir = arg.split('root=')[-1]
+ return location.startswith(top_dir)
+ elif arg == option:
+ if len(args) > index:
+ top_dir = args[index+1]
+ return location.startswith(top_dir)
+ if arg == '--user' and USER_SITE is not None:
+ return location.startswith(USER_SITE)
+ return True
+
+
+def _fake_setuptools():
+ log.warn('Scanning installed packages')
+ try:
+ import pkg_resources
+ except ImportError:
+ # we're cool
+ log.warn('Setuptools or Distribute does not seem to be installed.')
+ return
+ ws = pkg_resources.working_set
+ try:
+ setuptools_dist = ws.find(pkg_resources.Requirement.parse('setuptools',
+ replacement=False))
+ except TypeError:
+ # old distribute API
+ setuptools_dist = ws.find(pkg_resources.Requirement.parse('setuptools'))
+
+ if setuptools_dist is None:
+ log.warn('No setuptools distribution found')
+ return
+ # detecting if it was already faked
+ setuptools_location = setuptools_dist.location
+ log.warn('Setuptools installation detected at %s', setuptools_location)
+
+ # if --root or --preix was provided, and if
+ # setuptools is not located in them, we don't patch it
+ if not _under_prefix(setuptools_location):
+ log.warn('Not patching, --root or --prefix is installing Distribute'
+ ' in another location')
+ return
+
+ # let's see if its an egg
+ if not setuptools_location.endswith('.egg'):
+ log.warn('Non-egg installation')
+ res = _remove_flat_installation(setuptools_location)
+ if not res:
+ return
+ else:
+ log.warn('Egg installation')
+ pkg_info = os.path.join(setuptools_location, 'EGG-INFO', 'PKG-INFO')
+ if (os.path.exists(pkg_info) and
+ _same_content(pkg_info, SETUPTOOLS_PKG_INFO)):
+ log.warn('Already patched.')
+ return
+ log.warn('Patching...')
+ # let's create a fake egg replacing setuptools one
+ res = _patch_egg_dir(setuptools_location)
+ if not res:
+ return
+ log.warn('Patched done.')
+ _relaunch()
+
+
+def _relaunch():
+ log.warn('Relaunching...')
+ # we have to relaunch the process
+ # pip marker to avoid a relaunch bug
+ if sys.argv[:3] == ['-c', 'install', '--single-version-externally-managed']:
+ sys.argv[0] = 'setup.py'
+ args = [sys.executable] + sys.argv
+ sys.exit(subprocess.call(args))
+
+
+def _extractall(self, path=".", members=None):
+ """Extract all members from the archive to the current working
+ directory and set owner, modification time and permissions on
+ directories afterwards. `path' specifies a different directory
+ to extract to. `members' is optional and must be a subset of the
+ list returned by getmembers().
+ """
+ import copy
+ import operator
+ from tarfile import ExtractError
+ directories = []
+
+ if members is None:
+ members = self
+
+ for tarinfo in members:
+ if tarinfo.isdir():
+ # Extract directories with a safe mode.
+ directories.append(tarinfo)
+ tarinfo = copy.copy(tarinfo)
+ tarinfo.mode = 448 # decimal for oct 0700
+ self.extract(tarinfo, path)
+
+ # Reverse sort directories.
+ if sys.version_info < (2, 4):
+ def sorter(dir1, dir2):
+ return cmp(dir1.name, dir2.name)
+ directories.sort(sorter)
+ directories.reverse()
+ else:
+ directories.sort(key=operator.attrgetter('name'), reverse=True)
+
+ # Set correct owner, mtime and filemode on directories.
+ for tarinfo in directories:
+ dirpath = os.path.join(path, tarinfo.name)
+ try:
+ self.chown(tarinfo, dirpath)
+ self.utime(tarinfo, dirpath)
+ self.chmod(tarinfo, dirpath)
+ except ExtractError:
+ e = sys.exc_info()[1]
+ if self.errorlevel > 1:
+ raise
+ else:
+ self._dbg(1, "tarfile: %s" % e)
+
+
+def main(argv, version=DEFAULT_VERSION):
+ """Install or upgrade setuptools and EasyInstall"""
+ tarball = download_setuptools()
+ _install(tarball)
+
+
+if __name__ == '__main__':
+ main(sys.argv[1:])
diff --git a/doc/rtd-requirements.txt b/doc/rtd-requirements.txt
new file mode 100644
index 0000000..2872958
--- /dev/null
+++ b/doc/rtd-requirements.txt
@@ -0,0 +1,3 @@
+# requirements file for Read The Docs
+# http://readthedocs.org/docs/nose/
+sphinx>=1.0
diff --git a/functional_tests/doc_tests/test_addplugins/support/test.pyc b/functional_tests/doc_tests/test_addplugins/support/test.pyc
new file mode 100644
index 0000000..712c5ea
--- /dev/null
+++ b/functional_tests/doc_tests/test_addplugins/support/test.pyc
Binary files differ
diff --git a/functional_tests/doc_tests/test_allmodules/support/mod.pyc b/functional_tests/doc_tests/test_allmodules/support/mod.pyc
new file mode 100644
index 0000000..a53311a
--- /dev/null
+++ b/functional_tests/doc_tests/test_allmodules/support/mod.pyc
Binary files differ
diff --git a/functional_tests/doc_tests/test_allmodules/support/test.pyc b/functional_tests/doc_tests/test_allmodules/support/test.pyc
new file mode 100644
index 0000000..8556899
--- /dev/null
+++ b/functional_tests/doc_tests/test_allmodules/support/test.pyc
Binary files differ
diff --git a/functional_tests/doc_tests/test_coverage_html/coverage_html_fixtures.pyc b/functional_tests/doc_tests/test_coverage_html/coverage_html_fixtures.pyc
new file mode 100644
index 0000000..1b79401
--- /dev/null
+++ b/functional_tests/doc_tests/test_coverage_html/coverage_html_fixtures.pyc
Binary files differ
diff --git a/functional_tests/doc_tests/test_coverage_html/support/blah.pyc b/functional_tests/doc_tests/test_coverage_html/support/blah.pyc
new file mode 100644
index 0000000..cb8c284
--- /dev/null
+++ b/functional_tests/doc_tests/test_coverage_html/support/blah.pyc
Binary files differ
diff --git a/functional_tests/doc_tests/test_coverage_html/support/tests/test_covered.pyc b/functional_tests/doc_tests/test_coverage_html/support/tests/test_covered.pyc
new file mode 100644
index 0000000..51582f2
--- /dev/null
+++ b/functional_tests/doc_tests/test_coverage_html/support/tests/test_covered.pyc
Binary files differ
diff --git a/functional_tests/doc_tests/test_doctest_fixtures/doctest_fixtures_fixtures.pyc b/functional_tests/doc_tests/test_doctest_fixtures/doctest_fixtures_fixtures.pyc
new file mode 100644
index 0000000..a48431d
--- /dev/null
+++ b/functional_tests/doc_tests/test_doctest_fixtures/doctest_fixtures_fixtures.pyc
Binary files differ
diff --git a/functional_tests/doc_tests/test_init_plugin/example.cfg b/functional_tests/doc_tests/test_init_plugin/example.cfg
new file mode 100644
index 0000000..b02ac0e
--- /dev/null
+++ b/functional_tests/doc_tests/test_init_plugin/example.cfg
@@ -0,0 +1,3 @@
+[DEFAULT]
+can_frobnicate = 1
+likes_cheese = 0
diff --git a/functional_tests/doc_tests/test_init_plugin/init_plugin.rst.py3.patch b/functional_tests/doc_tests/test_init_plugin/init_plugin.rst.py3.patch
new file mode 100644
index 0000000..90a0a44
--- /dev/null
+++ b/functional_tests/doc_tests/test_init_plugin/init_plugin.rst.py3.patch
@@ -0,0 +1,10 @@
+--- init_plugin.rst.orig 2010-08-31 10:36:54.000000000 -0700
++++ init_plugin.rst 2010-08-31 10:37:30.000000000 -0700
+@@ -143,6 +143,7 @@
+ ... can_frobnicate = 1
+ ... likes_cheese = 0
+ ... """)
++ 46
+
+ Now we can execute a test run using that configuration, after first
+ resetting the widget system to an unconfigured state.
diff --git a/functional_tests/doc_tests/test_issue089/support/unwanted_package/__init__.pyc b/functional_tests/doc_tests/test_issue089/support/unwanted_package/__init__.pyc
new file mode 100644
index 0000000..0fffbc4
--- /dev/null
+++ b/functional_tests/doc_tests/test_issue089/support/unwanted_package/__init__.pyc
Binary files differ
diff --git a/functional_tests/doc_tests/test_issue089/support/unwanted_package/test_spam.pyc b/functional_tests/doc_tests/test_issue089/support/unwanted_package/test_spam.pyc
new file mode 100644
index 0000000..8688796
--- /dev/null
+++ b/functional_tests/doc_tests/test_issue089/support/unwanted_package/test_spam.pyc
Binary files differ
diff --git a/functional_tests/doc_tests/test_issue089/support/wanted_package/__init__.pyc b/functional_tests/doc_tests/test_issue089/support/wanted_package/__init__.pyc
new file mode 100644
index 0000000..7475436
--- /dev/null
+++ b/functional_tests/doc_tests/test_issue089/support/wanted_package/__init__.pyc
Binary files differ
diff --git a/functional_tests/doc_tests/test_issue089/support/wanted_package/test_eggs.pyc b/functional_tests/doc_tests/test_issue089/support/wanted_package/test_eggs.pyc
new file mode 100644
index 0000000..8ad2dc1
--- /dev/null
+++ b/functional_tests/doc_tests/test_issue089/support/wanted_package/test_eggs.pyc
Binary files differ
diff --git a/functional_tests/doc_tests/test_issue107/support/test_spam.pyc b/functional_tests/doc_tests/test_issue107/support/test_spam.pyc
new file mode 100644
index 0000000..5565d94
--- /dev/null
+++ b/functional_tests/doc_tests/test_issue107/support/test_spam.pyc
Binary files differ
diff --git a/functional_tests/doc_tests/test_issue119/test_zeronine.pyc b/functional_tests/doc_tests/test_issue119/test_zeronine.pyc
new file mode 100644
index 0000000..6a33e05
--- /dev/null
+++ b/functional_tests/doc_tests/test_issue119/test_zeronine.pyc
Binary files differ
diff --git a/functional_tests/doc_tests/test_issue142/support/errorclass_failing_test.pyc b/functional_tests/doc_tests/test_issue142/support/errorclass_failing_test.pyc
new file mode 100644
index 0000000..a476a5c
--- /dev/null
+++ b/functional_tests/doc_tests/test_issue142/support/errorclass_failing_test.pyc
Binary files differ
diff --git a/functional_tests/doc_tests/test_issue142/support/errorclass_failure_plugin.pyc b/functional_tests/doc_tests/test_issue142/support/errorclass_failure_plugin.pyc
new file mode 100644
index 0000000..df746cc
--- /dev/null
+++ b/functional_tests/doc_tests/test_issue142/support/errorclass_failure_plugin.pyc
Binary files differ
diff --git a/functional_tests/doc_tests/test_issue142/support/errorclass_tests.pyc b/functional_tests/doc_tests/test_issue142/support/errorclass_tests.pyc
new file mode 100644
index 0000000..2fd336d
--- /dev/null
+++ b/functional_tests/doc_tests/test_issue142/support/errorclass_tests.pyc
Binary files differ
diff --git a/functional_tests/doc_tests/test_issue145/support/package1/__init__.pyc b/functional_tests/doc_tests/test_issue145/support/package1/__init__.pyc
new file mode 100644
index 0000000..66cb7d3
--- /dev/null
+++ b/functional_tests/doc_tests/test_issue145/support/package1/__init__.pyc
Binary files differ
diff --git a/functional_tests/doc_tests/test_issue145/support/package1/test_module.pyc b/functional_tests/doc_tests/test_issue145/support/package1/test_module.pyc
new file mode 100644
index 0000000..fbbb583
--- /dev/null
+++ b/functional_tests/doc_tests/test_issue145/support/package1/test_module.pyc
Binary files differ
diff --git a/functional_tests/doc_tests/test_issue145/support/package2c/__init__.pyc b/functional_tests/doc_tests/test_issue145/support/package2c/__init__.pyc
new file mode 100644
index 0000000..c43bf46
--- /dev/null
+++ b/functional_tests/doc_tests/test_issue145/support/package2c/__init__.pyc
Binary files differ
diff --git a/functional_tests/doc_tests/test_issue145/support/package2c/test_module.pyc b/functional_tests/doc_tests/test_issue145/support/package2c/test_module.pyc
new file mode 100644
index 0000000..59d0732
--- /dev/null
+++ b/functional_tests/doc_tests/test_issue145/support/package2c/test_module.pyc
Binary files differ
diff --git a/functional_tests/doc_tests/test_issue145/support/package2f/__init__.pyc b/functional_tests/doc_tests/test_issue145/support/package2f/__init__.pyc
new file mode 100644
index 0000000..920c873
--- /dev/null
+++ b/functional_tests/doc_tests/test_issue145/support/package2f/__init__.pyc
Binary files differ
diff --git a/functional_tests/doc_tests/test_issue145/support/package2f/test_module.pyc b/functional_tests/doc_tests/test_issue145/support/package2f/test_module.pyc
new file mode 100644
index 0000000..0bfdaf3
--- /dev/null
+++ b/functional_tests/doc_tests/test_issue145/support/package2f/test_module.pyc
Binary files differ
diff --git a/functional_tests/doc_tests/test_multiprocess/multiprocess_fixtures.pyc b/functional_tests/doc_tests/test_multiprocess/multiprocess_fixtures.pyc
new file mode 100644
index 0000000..bbd8eb3
--- /dev/null
+++ b/functional_tests/doc_tests/test_multiprocess/multiprocess_fixtures.pyc
Binary files differ
diff --git a/functional_tests/doc_tests/test_multiprocess/support/test_can_split.pyc b/functional_tests/doc_tests/test_multiprocess/support/test_can_split.pyc
new file mode 100644
index 0000000..71a0524
--- /dev/null
+++ b/functional_tests/doc_tests/test_multiprocess/support/test_can_split.pyc
Binary files differ
diff --git a/functional_tests/doc_tests/test_multiprocess/support/test_not_shared.pyc b/functional_tests/doc_tests/test_multiprocess/support/test_not_shared.pyc
new file mode 100644
index 0000000..6e7d0c7
--- /dev/null
+++ b/functional_tests/doc_tests/test_multiprocess/support/test_not_shared.pyc
Binary files differ
diff --git a/functional_tests/doc_tests/test_multiprocess/support/test_shared.pyc b/functional_tests/doc_tests/test_multiprocess/support/test_shared.pyc
new file mode 100644
index 0000000..720ceb6
--- /dev/null
+++ b/functional_tests/doc_tests/test_multiprocess/support/test_shared.pyc
Binary files differ
diff --git a/functional_tests/doc_tests/test_restricted_plugin_options/restricted_plugin_options.rst.py3.patch b/functional_tests/doc_tests/test_restricted_plugin_options/restricted_plugin_options.rst.py3.patch
new file mode 100644
index 0000000..51a09b4
--- /dev/null
+++ b/functional_tests/doc_tests/test_restricted_plugin_options/restricted_plugin_options.rst.py3.patch
@@ -0,0 +1,9 @@
+--- restricted_plugin_options.rst.orig 2010-08-31 10:57:04.000000000 -0700
++++ restricted_plugin_options.rst 2010-08-31 10:57:51.000000000 -0700
+@@ -86,5 +86,5 @@
+ >>> run(argv=argv, plugins=restricted) # doctest: +ELLIPSIS
+ Traceback (most recent call last):
+ ...
+- ConfigError: Error reading config file '...bad.cfg': no such option 'with-meltedcheese'
++ nose.config.ConfigError: Error reading config file '...bad.cfg': no such option 'with-meltedcheese'
+
diff --git a/functional_tests/doc_tests/test_restricted_plugin_options/support/test.pyc b/functional_tests/doc_tests/test_restricted_plugin_options/support/test.pyc
new file mode 100644
index 0000000..b0541be
--- /dev/null
+++ b/functional_tests/doc_tests/test_restricted_plugin_options/support/test.pyc
Binary files differ
diff --git a/functional_tests/doc_tests/test_selector_plugin/support/mymodule.pyc b/functional_tests/doc_tests/test_selector_plugin/support/mymodule.pyc
new file mode 100644
index 0000000..4fa6953
--- /dev/null
+++ b/functional_tests/doc_tests/test_selector_plugin/support/mymodule.pyc
Binary files differ
diff --git a/functional_tests/doc_tests/test_selector_plugin/support/mypackage/__init__.pyc b/functional_tests/doc_tests/test_selector_plugin/support/mypackage/__init__.pyc
new file mode 100644
index 0000000..ee0e388
--- /dev/null
+++ b/functional_tests/doc_tests/test_selector_plugin/support/mypackage/__init__.pyc
Binary files differ
diff --git a/functional_tests/doc_tests/test_selector_plugin/support/mypackage/math/__init__.pyc b/functional_tests/doc_tests/test_selector_plugin/support/mypackage/math/__init__.pyc
new file mode 100644
index 0000000..1b504ed
--- /dev/null
+++ b/functional_tests/doc_tests/test_selector_plugin/support/mypackage/math/__init__.pyc
Binary files differ
diff --git a/functional_tests/doc_tests/test_selector_plugin/support/mypackage/math/basic.pyc b/functional_tests/doc_tests/test_selector_plugin/support/mypackage/math/basic.pyc
new file mode 100644
index 0000000..4733dd8
--- /dev/null
+++ b/functional_tests/doc_tests/test_selector_plugin/support/mypackage/math/basic.pyc
Binary files differ
diff --git a/functional_tests/doc_tests/test_selector_plugin/support/mypackage/strings.pyc b/functional_tests/doc_tests/test_selector_plugin/support/mypackage/strings.pyc
new file mode 100644
index 0000000..7be95ab
--- /dev/null
+++ b/functional_tests/doc_tests/test_selector_plugin/support/mypackage/strings.pyc
Binary files differ
diff --git a/functional_tests/doc_tests/test_selector_plugin/support/tests/math/basic.pyc b/functional_tests/doc_tests/test_selector_plugin/support/tests/math/basic.pyc
new file mode 100644
index 0000000..9862bca
--- /dev/null
+++ b/functional_tests/doc_tests/test_selector_plugin/support/tests/math/basic.pyc
Binary files differ
diff --git a/functional_tests/doc_tests/test_selector_plugin/support/tests/mymodule/my_function.pyc b/functional_tests/doc_tests/test_selector_plugin/support/tests/mymodule/my_function.pyc
new file mode 100644
index 0000000..57968fd
--- /dev/null
+++ b/functional_tests/doc_tests/test_selector_plugin/support/tests/mymodule/my_function.pyc
Binary files differ
diff --git a/functional_tests/doc_tests/test_selector_plugin/support/tests/strings/cat.pyc b/functional_tests/doc_tests/test_selector_plugin/support/tests/strings/cat.pyc
new file mode 100644
index 0000000..36a91f2
--- /dev/null
+++ b/functional_tests/doc_tests/test_selector_plugin/support/tests/strings/cat.pyc
Binary files differ
diff --git a/functional_tests/doc_tests/test_selector_plugin/support/tests/testlib.pyc b/functional_tests/doc_tests/test_selector_plugin/support/tests/testlib.pyc
new file mode 100644
index 0000000..bb47670
--- /dev/null
+++ b/functional_tests/doc_tests/test_selector_plugin/support/tests/testlib.pyc
Binary files differ
diff --git a/functional_tests/doc_tests/test_xunit_plugin/support/nosetests.xml b/functional_tests/doc_tests/test_xunit_plugin/support/nosetests.xml
new file mode 100644
index 0000000..1d242f5
--- /dev/null
+++ b/functional_tests/doc_tests/test_xunit_plugin/support/nosetests.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?><testsuite name="nosetests" tests="4" errors="1" failures="1" skip="1"><testcase classname="test_skip" name="test_ok" time="0.002" /><testcase classname="test_skip" name="test_err" time="0.000"><error type="exceptions.Exception" message="oh no"><![CDATA[Traceback (most recent call last):
+ File "/usr/local/lib/python2.6/unittest.py", line 279, in run
+ testMethod()
+ File "/home/jpellerin/code/nose-gh/nose/case.py", line 197, in runTest
+ self.test(*self.arg)
+ File "/home/jpellerin/code/nose-gh/functional_tests/doc_tests/test_xunit_plugin/support/test_skip.py", line 7, in test_err
+ raise Exception("oh no")
+Exception: oh no
+]]></error></testcase><testcase classname="test_skip" name="test_fail" time="0.000"><failure type="exceptions.AssertionError" message="bye"><![CDATA[Traceback (most recent call last):
+ File "/usr/local/lib/python2.6/unittest.py", line 279, in run
+ testMethod()
+ File "/home/jpellerin/code/nose-gh/nose/case.py", line 197, in runTest
+ self.test(*self.arg)
+ File "/home/jpellerin/code/nose-gh/functional_tests/doc_tests/test_xunit_plugin/support/test_skip.py", line 10, in test_fail
+ assert False, "bye"
+AssertionError: bye
+]]></failure></testcase><testcase classname="test_skip" name="test_skip" time="0.000"><skipped type="nose.plugins.skip.SkipTest" message="not me"><![CDATA[Traceback (most recent call last):
+ File "/usr/local/lib/python2.6/unittest.py", line 279, in run
+ testMethod()
+ File "/home/jpellerin/code/nose-gh/nose/case.py", line 197, in runTest
+ self.test(*self.arg)
+ File "/home/jpellerin/code/nose-gh/functional_tests/doc_tests/test_xunit_plugin/support/test_skip.py", line 13, in test_skip
+ raise SkipTest("not me")
+SkipTest: not me
+]]></skipped></testcase></testsuite> \ No newline at end of file
diff --git a/functional_tests/doc_tests/test_xunit_plugin/support/test_skip.pyc b/functional_tests/doc_tests/test_xunit_plugin/support/test_skip.pyc
new file mode 100644
index 0000000..f9204ad
--- /dev/null
+++ b/functional_tests/doc_tests/test_xunit_plugin/support/test_skip.pyc
Binary files differ
diff --git a/functional_tests/support/att/test_attr.pyc b/functional_tests/support/att/test_attr.pyc
new file mode 100644
index 0000000..02c14fd
--- /dev/null
+++ b/functional_tests/support/att/test_attr.pyc
Binary files differ
diff --git a/functional_tests/support/coverage/blah.py b/functional_tests/support/coverage/blah.py
new file mode 100644
index 0000000..ef6657c
--- /dev/null
+++ b/functional_tests/support/coverage/blah.py
@@ -0,0 +1,6 @@
+def dostuff():
+ print 'hi'
+
+
+def notcov():
+ print 'not covered'
diff --git a/functional_tests/support/coverage/blah.pyc b/functional_tests/support/coverage/blah.pyc
new file mode 100644
index 0000000..6753b9f
--- /dev/null
+++ b/functional_tests/support/coverage/blah.pyc
Binary files differ
diff --git a/functional_tests/support/coverage/tests/test_covered.py b/functional_tests/support/coverage/tests/test_covered.py
new file mode 100644
index 0000000..c669c5c
--- /dev/null
+++ b/functional_tests/support/coverage/tests/test_covered.py
@@ -0,0 +1,4 @@
+import blah
+
+def test_blah():
+ blah.dostuff()
diff --git a/functional_tests/support/coverage/tests/test_covered.pyc b/functional_tests/support/coverage/tests/test_covered.pyc
new file mode 100644
index 0000000..29c6755
--- /dev/null
+++ b/functional_tests/support/coverage/tests/test_covered.pyc
Binary files differ
diff --git a/functional_tests/support/coverage2/blah.py b/functional_tests/support/coverage2/blah.py
new file mode 100644
index 0000000..ef6657c
--- /dev/null
+++ b/functional_tests/support/coverage2/blah.py
@@ -0,0 +1,6 @@
+def dostuff():
+ print 'hi'
+
+
+def notcov():
+ print 'not covered'
diff --git a/functional_tests/support/coverage2/moo.py b/functional_tests/support/coverage2/moo.py
new file mode 100644
index 0000000..7ad09bf
--- /dev/null
+++ b/functional_tests/support/coverage2/moo.py
@@ -0,0 +1,2 @@
+def moo():
+ print 'covered'
diff --git a/functional_tests/support/coverage2/moo.pyc b/functional_tests/support/coverage2/moo.pyc
new file mode 100644
index 0000000..303750b
--- /dev/null
+++ b/functional_tests/support/coverage2/moo.pyc
Binary files differ
diff --git a/functional_tests/support/coverage2/tests/test_covered.py b/functional_tests/support/coverage2/tests/test_covered.py
new file mode 100644
index 0000000..034f984
--- /dev/null
+++ b/functional_tests/support/coverage2/tests/test_covered.py
@@ -0,0 +1,8 @@
+import blah
+import moo
+
+def test_blah():
+ blah.dostuff()
+
+def test_moo():
+ moo.dostuff()
diff --git a/functional_tests/support/coverage2/tests/test_covered.pyc b/functional_tests/support/coverage2/tests/test_covered.pyc
new file mode 100644
index 0000000..0f94350
--- /dev/null
+++ b/functional_tests/support/coverage2/tests/test_covered.pyc
Binary files differ
diff --git a/functional_tests/support/ctx/mod_import_skip.pyc b/functional_tests/support/ctx/mod_import_skip.pyc
new file mode 100644
index 0000000..c541041
--- /dev/null
+++ b/functional_tests/support/ctx/mod_import_skip.pyc
Binary files differ
diff --git a/functional_tests/support/ctx/mod_setup_fails.pyc b/functional_tests/support/ctx/mod_setup_fails.pyc
new file mode 100644
index 0000000..649bc11
--- /dev/null
+++ b/functional_tests/support/ctx/mod_setup_fails.pyc
Binary files differ
diff --git a/functional_tests/support/ctx/mod_setup_skip.pyc b/functional_tests/support/ctx/mod_setup_skip.pyc
new file mode 100644
index 0000000..3085b29
--- /dev/null
+++ b/functional_tests/support/ctx/mod_setup_skip.pyc
Binary files differ
diff --git a/functional_tests/support/dir1/mod.pyc b/functional_tests/support/dir1/mod.pyc
new file mode 100644
index 0000000..31d316b
--- /dev/null
+++ b/functional_tests/support/dir1/mod.pyc
Binary files differ
diff --git a/functional_tests/support/dir1/pak/__init__.pyc b/functional_tests/support/dir1/pak/__init__.pyc
new file mode 100644
index 0000000..0afffa2
--- /dev/null
+++ b/functional_tests/support/dir1/pak/__init__.pyc
Binary files differ
diff --git a/functional_tests/support/dir1/pak/mod.pyc b/functional_tests/support/dir1/pak/mod.pyc
new file mode 100644
index 0000000..0083bbc
--- /dev/null
+++ b/functional_tests/support/dir1/pak/mod.pyc
Binary files differ
diff --git a/functional_tests/support/dir1/pak/sub/__init__.pyc b/functional_tests/support/dir1/pak/sub/__init__.pyc
new file mode 100644
index 0000000..cfe6b8a
--- /dev/null
+++ b/functional_tests/support/dir1/pak/sub/__init__.pyc
Binary files differ
diff --git a/functional_tests/support/dir2/mod.pyc b/functional_tests/support/dir2/mod.pyc
new file mode 100644
index 0000000..aacf3c0
--- /dev/null
+++ b/functional_tests/support/dir2/mod.pyc
Binary files differ
diff --git a/functional_tests/support/dir2/pak/__init__.pyc b/functional_tests/support/dir2/pak/__init__.pyc
new file mode 100644
index 0000000..020a6fc
--- /dev/null
+++ b/functional_tests/support/dir2/pak/__init__.pyc
Binary files differ
diff --git a/functional_tests/support/dir2/pak/mod.pyc b/functional_tests/support/dir2/pak/mod.pyc
new file mode 100644
index 0000000..003d12b
--- /dev/null
+++ b/functional_tests/support/dir2/pak/mod.pyc
Binary files differ
diff --git a/functional_tests/support/dir2/pak/sub/__init__.pyc b/functional_tests/support/dir2/pak/sub/__init__.pyc
new file mode 100644
index 0000000..9c72be0
--- /dev/null
+++ b/functional_tests/support/dir2/pak/sub/__init__.pyc
Binary files differ
diff --git a/functional_tests/support/dtt/some_mod.pyc b/functional_tests/support/dtt/some_mod.pyc
new file mode 100644
index 0000000..10625c9
--- /dev/null
+++ b/functional_tests/support/dtt/some_mod.pyc
Binary files differ
diff --git a/functional_tests/support/fdp/test_fdp.pyc b/functional_tests/support/fdp/test_fdp.pyc
new file mode 100644
index 0000000..8d7554d
--- /dev/null
+++ b/functional_tests/support/fdp/test_fdp.pyc
Binary files differ
diff --git a/functional_tests/support/fdp/test_fdp_no_capt.pyc b/functional_tests/support/fdp/test_fdp_no_capt.pyc
new file mode 100644
index 0000000..c5179d0
--- /dev/null
+++ b/functional_tests/support/fdp/test_fdp_no_capt.pyc
Binary files differ
diff --git a/functional_tests/support/gen/test.pyc b/functional_tests/support/gen/test.pyc
new file mode 100644
index 0000000..04b68b0
--- /dev/null
+++ b/functional_tests/support/gen/test.pyc
Binary files differ
diff --git a/functional_tests/support/id_fails/test_a.pyc b/functional_tests/support/id_fails/test_a.pyc
new file mode 100644
index 0000000..c4b1eb7
--- /dev/null
+++ b/functional_tests/support/id_fails/test_a.pyc
Binary files differ
diff --git a/functional_tests/support/id_fails/test_b.pyc b/functional_tests/support/id_fails/test_b.pyc
new file mode 100644
index 0000000..e4f2222
--- /dev/null
+++ b/functional_tests/support/id_fails/test_b.pyc
Binary files differ
diff --git a/functional_tests/support/idp/exm.pyc b/functional_tests/support/idp/exm.pyc
new file mode 100644
index 0000000..55dc40c
--- /dev/null
+++ b/functional_tests/support/idp/exm.pyc
Binary files differ
diff --git a/functional_tests/support/idp/tests.pyc b/functional_tests/support/idp/tests.pyc
new file mode 100644
index 0000000..a5281b5
--- /dev/null
+++ b/functional_tests/support/idp/tests.pyc
Binary files differ
diff --git a/functional_tests/support/ipt/test1/ipthelp.pyc b/functional_tests/support/ipt/test1/ipthelp.pyc
new file mode 100644
index 0000000..b232451
--- /dev/null
+++ b/functional_tests/support/ipt/test1/ipthelp.pyc
Binary files differ
diff --git a/functional_tests/support/ipt/test1/tests.pyc b/functional_tests/support/ipt/test1/tests.pyc
new file mode 100644
index 0000000..d7b3bee
--- /dev/null
+++ b/functional_tests/support/ipt/test1/tests.pyc
Binary files differ
diff --git a/functional_tests/support/ipt/test2/ipthelp.pyc b/functional_tests/support/ipt/test2/ipthelp.pyc
new file mode 100644
index 0000000..2f069ea
--- /dev/null
+++ b/functional_tests/support/ipt/test2/ipthelp.pyc
Binary files differ
diff --git a/functional_tests/support/ipt/test2/tests.pyc b/functional_tests/support/ipt/test2/tests.pyc
new file mode 100644
index 0000000..b6e26f8
--- /dev/null
+++ b/functional_tests/support/ipt/test2/tests.pyc
Binary files differ
diff --git a/functional_tests/support/issue038/test.pyc b/functional_tests/support/issue038/test.pyc
new file mode 100644
index 0000000..0fa5418
--- /dev/null
+++ b/functional_tests/support/issue038/test.pyc
Binary files differ
diff --git a/functional_tests/support/issue072/test.pyc b/functional_tests/support/issue072/test.pyc
new file mode 100644
index 0000000..520ba85
--- /dev/null
+++ b/functional_tests/support/issue072/test.pyc
Binary files differ
diff --git a/functional_tests/support/issue082/mypublicpackage/__init__.pyc b/functional_tests/support/issue082/mypublicpackage/__init__.pyc
new file mode 100644
index 0000000..9f28689
--- /dev/null
+++ b/functional_tests/support/issue082/mypublicpackage/__init__.pyc
Binary files differ
diff --git a/functional_tests/support/issue082/mypublicpackage/_foo.pyc b/functional_tests/support/issue082/mypublicpackage/_foo.pyc
new file mode 100644
index 0000000..b8e06e0
--- /dev/null
+++ b/functional_tests/support/issue082/mypublicpackage/_foo.pyc
Binary files differ
diff --git a/functional_tests/support/issue082/mypublicpackage/bar.pyc b/functional_tests/support/issue082/mypublicpackage/bar.pyc
new file mode 100644
index 0000000..9a91793
--- /dev/null
+++ b/functional_tests/support/issue082/mypublicpackage/bar.pyc
Binary files differ
diff --git a/functional_tests/support/issue130/test.pyc b/functional_tests/support/issue130/test.pyc
new file mode 100644
index 0000000..c93851e
--- /dev/null
+++ b/functional_tests/support/issue130/test.pyc
Binary files differ
diff --git a/functional_tests/support/issue191/UNKNOWN.egg-info/PKG-INFO b/functional_tests/support/issue191/UNKNOWN.egg-info/PKG-INFO
new file mode 100644
index 0000000..11b3dcd
--- /dev/null
+++ b/functional_tests/support/issue191/UNKNOWN.egg-info/PKG-INFO
@@ -0,0 +1,10 @@
+Metadata-Version: 1.0
+Name: UNKNOWN
+Version: 0.0.0
+Summary: UNKNOWN
+Home-page: UNKNOWN
+Author: UNKNOWN
+Author-email: UNKNOWN
+License: UNKNOWN
+Description: UNKNOWN
+Platform: UNKNOWN
diff --git a/functional_tests/support/issue191/UNKNOWN.egg-info/SOURCES.txt b/functional_tests/support/issue191/UNKNOWN.egg-info/SOURCES.txt
new file mode 100644
index 0000000..75d8cfe
--- /dev/null
+++ b/functional_tests/support/issue191/UNKNOWN.egg-info/SOURCES.txt
@@ -0,0 +1,6 @@
+setup.cfg
+setup.py
+UNKNOWN.egg-info/PKG-INFO
+UNKNOWN.egg-info/SOURCES.txt
+UNKNOWN.egg-info/dependency_links.txt
+UNKNOWN.egg-info/top_level.txt \ No newline at end of file
diff --git a/functional_tests/support/issue191/UNKNOWN.egg-info/dependency_links.txt b/functional_tests/support/issue191/UNKNOWN.egg-info/dependency_links.txt
new file mode 100644
index 0000000..8b13789
--- /dev/null
+++ b/functional_tests/support/issue191/UNKNOWN.egg-info/dependency_links.txt
@@ -0,0 +1 @@
+
diff --git a/functional_tests/support/issue191/UNKNOWN.egg-info/top_level.txt b/functional_tests/support/issue191/UNKNOWN.egg-info/top_level.txt
new file mode 100644
index 0000000..8b13789
--- /dev/null
+++ b/functional_tests/support/issue191/UNKNOWN.egg-info/top_level.txt
@@ -0,0 +1 @@
+
diff --git a/functional_tests/support/issue191/test.pyc b/functional_tests/support/issue191/test.pyc
new file mode 100644
index 0000000..5fe368c
--- /dev/null
+++ b/functional_tests/support/issue191/test.pyc
Binary files differ
diff --git a/functional_tests/support/issue269/test_bad_class.pyc b/functional_tests/support/issue269/test_bad_class.pyc
new file mode 100644
index 0000000..217b159
--- /dev/null
+++ b/functional_tests/support/issue269/test_bad_class.pyc
Binary files differ
diff --git a/functional_tests/support/issue279/test_mod_setup_fails.pyc b/functional_tests/support/issue279/test_mod_setup_fails.pyc
new file mode 100644
index 0000000..f172ec5
--- /dev/null
+++ b/functional_tests/support/issue279/test_mod_setup_fails.pyc
Binary files differ
diff --git a/functional_tests/support/issue408/nosetests.xml b/functional_tests/support/issue408/nosetests.xml
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/functional_tests/support/issue408/nosetests.xml
diff --git a/functional_tests/support/issue408/test.py b/functional_tests/support/issue408/test.py
new file mode 100644
index 0000000..a5e88e9
--- /dev/null
+++ b/functional_tests/support/issue408/test.py
@@ -0,0 +1,16 @@
+class base:
+ @classmethod
+ def setup_class(cls):
+ cls.inited = 1
+ @classmethod
+ def teardown_class(cls):
+ cls.inited = 0
+ def test1(self):
+ assert self.inited
+ def test2(self):
+ assert self.inited
+
+class testa(base):
+ pass
+class testb(base):
+ pass
diff --git a/functional_tests/support/issue408/test.pyc b/functional_tests/support/issue408/test.pyc
new file mode 100644
index 0000000..689957a
--- /dev/null
+++ b/functional_tests/support/issue408/test.pyc
Binary files differ
diff --git a/functional_tests/support/ltfn/state.pyc b/functional_tests/support/ltfn/state.pyc
new file mode 100644
index 0000000..322e690
--- /dev/null
+++ b/functional_tests/support/ltfn/state.pyc
Binary files differ
diff --git a/functional_tests/support/ltfn/test_mod.pyc b/functional_tests/support/ltfn/test_mod.pyc
new file mode 100644
index 0000000..2264b2d
--- /dev/null
+++ b/functional_tests/support/ltfn/test_mod.pyc
Binary files differ
diff --git a/functional_tests/support/ltfn/test_pak1/__init__.pyc b/functional_tests/support/ltfn/test_pak1/__init__.pyc
new file mode 100644
index 0000000..8f42014
--- /dev/null
+++ b/functional_tests/support/ltfn/test_pak1/__init__.pyc
Binary files differ
diff --git a/functional_tests/support/ltfn/test_pak1/test_mod.pyc b/functional_tests/support/ltfn/test_pak1/test_mod.pyc
new file mode 100644
index 0000000..b54e0b2
--- /dev/null
+++ b/functional_tests/support/ltfn/test_pak1/test_mod.pyc
Binary files differ
diff --git a/functional_tests/support/ltfn/test_pak2/__init__.pyc b/functional_tests/support/ltfn/test_pak2/__init__.pyc
new file mode 100644
index 0000000..a044dc3
--- /dev/null
+++ b/functional_tests/support/ltfn/test_pak2/__init__.pyc
Binary files differ
diff --git a/functional_tests/support/ltftc/tests.pyc b/functional_tests/support/ltftc/tests.pyc
new file mode 100644
index 0000000..1d45627
--- /dev/null
+++ b/functional_tests/support/ltftc/tests.pyc
Binary files differ
diff --git a/functional_tests/support/namespace_pkg/namespace_pkg/__init__.pyc b/functional_tests/support/namespace_pkg/namespace_pkg/__init__.pyc
new file mode 100644
index 0000000..897fc62
--- /dev/null
+++ b/functional_tests/support/namespace_pkg/namespace_pkg/__init__.pyc
Binary files differ
diff --git a/functional_tests/support/namespace_pkg/namespace_pkg/example.pyc b/functional_tests/support/namespace_pkg/namespace_pkg/example.pyc
new file mode 100644
index 0000000..1563e59
--- /dev/null
+++ b/functional_tests/support/namespace_pkg/namespace_pkg/example.pyc
Binary files differ
diff --git a/functional_tests/support/namespace_pkg/namespace_pkg/test_pkg.pyc b/functional_tests/support/namespace_pkg/namespace_pkg/test_pkg.pyc
new file mode 100644
index 0000000..466e58a
--- /dev/null
+++ b/functional_tests/support/namespace_pkg/namespace_pkg/test_pkg.pyc
Binary files differ
diff --git a/functional_tests/support/namespace_pkg/site-packages/namespace_pkg/example2.pyc b/functional_tests/support/namespace_pkg/site-packages/namespace_pkg/example2.pyc
new file mode 100644
index 0000000..07baec2
--- /dev/null
+++ b/functional_tests/support/namespace_pkg/site-packages/namespace_pkg/example2.pyc
Binary files differ
diff --git a/functional_tests/support/namespace_pkg/site-packages/namespace_pkg/test_pkg2.pyc b/functional_tests/support/namespace_pkg/site-packages/namespace_pkg/test_pkg2.pyc
new file mode 100644
index 0000000..ac58c71
--- /dev/null
+++ b/functional_tests/support/namespace_pkg/site-packages/namespace_pkg/test_pkg2.pyc
Binary files differ
diff --git a/functional_tests/support/package1/example.pyc b/functional_tests/support/package1/example.pyc
new file mode 100644
index 0000000..298ed4e
--- /dev/null
+++ b/functional_tests/support/package1/example.pyc
Binary files differ
diff --git a/functional_tests/support/package1/tests/test_example_function.pyc b/functional_tests/support/package1/tests/test_example_function.pyc
new file mode 100644
index 0000000..e10f2f2
--- /dev/null
+++ b/functional_tests/support/package1/tests/test_example_function.pyc
Binary files differ
diff --git a/functional_tests/support/package2/maths.pyc b/functional_tests/support/package2/maths.pyc
new file mode 100644
index 0000000..660cfe1
--- /dev/null
+++ b/functional_tests/support/package2/maths.pyc
Binary files differ
diff --git a/functional_tests/support/package2/test_pak/__init__.pyc b/functional_tests/support/package2/test_pak/__init__.pyc
new file mode 100644
index 0000000..1f4ef67
--- /dev/null
+++ b/functional_tests/support/package2/test_pak/__init__.pyc
Binary files differ
diff --git a/functional_tests/support/package2/test_pak/test_mod.pyc b/functional_tests/support/package2/test_pak/test_mod.pyc
new file mode 100644
index 0000000..730aee2
--- /dev/null
+++ b/functional_tests/support/package2/test_pak/test_mod.pyc
Binary files differ
diff --git a/functional_tests/support/package2/test_pak/test_sub/__init__.pyc b/functional_tests/support/package2/test_pak/test_sub/__init__.pyc
new file mode 100644
index 0000000..4489581
--- /dev/null
+++ b/functional_tests/support/package2/test_pak/test_sub/__init__.pyc
Binary files differ
diff --git a/functional_tests/support/package2/test_pak/test_sub/test_mod.pyc b/functional_tests/support/package2/test_pak/test_sub/test_mod.pyc
new file mode 100644
index 0000000..005ca11
--- /dev/null
+++ b/functional_tests/support/package2/test_pak/test_sub/test_mod.pyc
Binary files differ
diff --git a/functional_tests/support/package3/lib/a.pyc b/functional_tests/support/package3/lib/a.pyc
new file mode 100644
index 0000000..62a73eb
--- /dev/null
+++ b/functional_tests/support/package3/lib/a.pyc
Binary files differ
diff --git a/functional_tests/support/package3/src/b.pyc b/functional_tests/support/package3/src/b.pyc
new file mode 100644
index 0000000..8080373
--- /dev/null
+++ b/functional_tests/support/package3/src/b.pyc
Binary files differ
diff --git a/functional_tests/support/package3/tests/test_a.pyc b/functional_tests/support/package3/tests/test_a.pyc
new file mode 100644
index 0000000..b6e7fcd
--- /dev/null
+++ b/functional_tests/support/package3/tests/test_a.pyc
Binary files differ
diff --git a/functional_tests/support/package3/tests/test_b.pyc b/functional_tests/support/package3/tests/test_b.pyc
new file mode 100644
index 0000000..faafaa4
--- /dev/null
+++ b/functional_tests/support/package3/tests/test_b.pyc
Binary files differ
diff --git a/functional_tests/support/pass/test.pyc b/functional_tests/support/pass/test.pyc
new file mode 100644
index 0000000..64f1ee0
--- /dev/null
+++ b/functional_tests/support/pass/test.pyc
Binary files differ
diff --git a/functional_tests/support/test_buggy_generators.pyc b/functional_tests/support/test_buggy_generators.pyc
new file mode 100644
index 0000000..becad88
--- /dev/null
+++ b/functional_tests/support/test_buggy_generators.pyc
Binary files differ
diff --git a/functional_tests/support/todo/test_with_todo.pyc b/functional_tests/support/todo/test_with_todo.pyc
new file mode 100644
index 0000000..9375d17
--- /dev/null
+++ b/functional_tests/support/todo/test_with_todo.pyc
Binary files differ
diff --git a/functional_tests/support/todo/todoplug.pyc b/functional_tests/support/todo/todoplug.pyc
new file mode 100644
index 0000000..9565f40
--- /dev/null
+++ b/functional_tests/support/todo/todoplug.pyc
Binary files differ
diff --git a/functional_tests/support/twist/test_twisted.pyc b/functional_tests/support/twist/test_twisted.pyc
new file mode 100644
index 0000000..24ddfa5
--- /dev/null
+++ b/functional_tests/support/twist/test_twisted.pyc
Binary files differ
diff --git a/functional_tests/support/xunit.xml b/functional_tests/support/xunit.xml
new file mode 100644
index 0000000..7cf345b
--- /dev/null
+++ b/functional_tests/support/xunit.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?><testsuite name="nosetests" tests="6" errors="2" failures="1" skip="1"><testcase classname="test_xunit_as_suite.TestForXunit" name="test_error" time="0.002"><error type="exceptions.TypeError" message="oops, wrong type"><![CDATA[Traceback (most recent call last):
+ File "/usr/lib/python2.7/unittest/case.py", line 327, in run
+ testMethod()
+ File "/home/jpellerin/code/nose-gh/functional_tests/support/xunit/test_xunit_as_suite.py", line 15, in test_error
+ raise TypeError("oops, wrong type")
+TypeError: oops, wrong type
+]]></error></testcase><testcase classname="test_xunit_as_suite.TestForXunit" name="test_fail" time="0.000"><failure type="exceptions.AssertionError" message="'this' != 'that'"><![CDATA[Traceback (most recent call last):
+ File "/usr/lib/python2.7/unittest/case.py", line 327, in run
+ testMethod()
+ File "/home/jpellerin/code/nose-gh/functional_tests/support/xunit/test_xunit_as_suite.py", line 12, in test_fail
+ self.assertEqual("this","that")
+ File "/usr/lib/python2.7/unittest/case.py", line 511, in assertEqual
+ assertion_func(first, second, msg=msg)
+ File "/usr/lib/python2.7/unittest/case.py", line 504, in _baseAssertEqual
+ raise self.failureException(msg)
+AssertionError: 'this' != 'that'
+]]></failure></testcase><testcase classname="test_xunit_as_suite.TestForXunit" name="test_non_ascii_error" time="0.000"><error type="exceptions.Exception" message="日本"><![CDATA[Traceback (most recent call last):
+ File "/usr/lib/python2.7/unittest/case.py", line 327, in run
+ testMethod()
+ File "/home/jpellerin/code/nose-gh/functional_tests/support/xunit/test_xunit_as_suite.py", line 18, in test_non_ascii_error
+ raise Exception(u"日本")
+Exception: \u65e5\u672c
+]]></error></testcase><testcase classname="test_xunit_as_suite.TestForXunit" name="test_output" time="0.000" /><testcase classname="test_xunit_as_suite.TestForXunit" name="test_skip" time="0.000"><skipped type="unittest.case.SkipTest" message="skipit"><![CDATA[SkipTest: skipit
+]]></skipped></testcase><testcase classname="test_xunit_as_suite.TestForXunit" name="test_success" time="0.000" /></testsuite> \ No newline at end of file
diff --git a/functional_tests/support/xunit/test_xunit_as_suite.pyc b/functional_tests/support/xunit/test_xunit_as_suite.pyc
new file mode 100644
index 0000000..fd84fe9
--- /dev/null
+++ b/functional_tests/support/xunit/test_xunit_as_suite.pyc
Binary files differ
diff --git a/functional_tests/test_attribute_plugin.pyc b/functional_tests/test_attribute_plugin.pyc
new file mode 100644
index 0000000..d962527
--- /dev/null
+++ b/functional_tests/test_attribute_plugin.pyc
Binary files differ
diff --git a/functional_tests/test_buggy_generators.pyc b/functional_tests/test_buggy_generators.pyc
new file mode 100644
index 0000000..3161552
--- /dev/null
+++ b/functional_tests/test_buggy_generators.pyc
Binary files differ
diff --git a/functional_tests/test_cases.pyc b/functional_tests/test_cases.pyc
new file mode 100644
index 0000000..05e0ce7
--- /dev/null
+++ b/functional_tests/test_cases.pyc
Binary files differ
diff --git a/functional_tests/test_collector.pyc b/functional_tests/test_collector.pyc
new file mode 100644
index 0000000..35a0426
--- /dev/null
+++ b/functional_tests/test_collector.pyc
Binary files differ
diff --git a/functional_tests/test_commands.pyc b/functional_tests/test_commands.pyc
new file mode 100644
index 0000000..9884faa
--- /dev/null
+++ b/functional_tests/test_commands.pyc
Binary files differ
diff --git a/functional_tests/test_config_files.pyc b/functional_tests/test_config_files.pyc
new file mode 100644
index 0000000..f430364
--- /dev/null
+++ b/functional_tests/test_config_files.pyc
Binary files differ
diff --git a/functional_tests/test_coverage_plugin.py b/functional_tests/test_coverage_plugin.py
new file mode 100644
index 0000000..717f13a
--- /dev/null
+++ b/functional_tests/test_coverage_plugin.py
@@ -0,0 +1,78 @@
+"""Test the coverage plugin."""
+import os
+import unittest
+import shutil
+
+from nose.plugins import PluginTester
+from nose.plugins.cover import Coverage
+
+support = os.path.join(os.path.dirname(__file__), 'support')
+
+
+class TestCoveragePlugin(PluginTester, unittest.TestCase):
+ activate = "--with-coverage"
+ args = ['-v', '--cover-package=blah', '--cover-html', '--cover-min-percentage', '25']
+ plugins = [Coverage()]
+ suitepath = os.path.join(support, 'coverage')
+
+ def setUp(self):
+ self.cover_file = os.path.join(os.getcwd(), '.coverage')
+ self.cover_html_dir = os.path.join(os.getcwd(), 'cover')
+ if os.path.exists(self.cover_file):
+ os.unlink(self.cover_file)
+ if os.path.exists(self.cover_html_dir):
+ shutil.rmtree(self.cover_html_dir)
+ super(TestCoveragePlugin, self).setUp()
+
+ def runTest(self):
+ self.assertTrue("blah 4 3 25% 1" in self.output)
+ self.assertTrue("Ran 1 test in""" in self.output)
+ # Assert coverage html report exists
+ self.assertTrue(os.path.exists(os.path.join(self.cover_html_dir,
+ 'index.html')))
+ # Assert coverage data is saved
+ self.assertTrue(os.path.exists(self.cover_file))
+
+
+class TestCoverageMinPercentagePlugin(PluginTester, unittest.TestCase):
+ activate = "--with-coverage"
+ args = ['-v', '--cover-package=blah', '--cover-min-percentage', '100']
+ plugins = [Coverage()]
+ suitepath = os.path.join(support, 'coverage')
+
+ def setUp(self):
+ self.cover_file = os.path.join(os.getcwd(), '.coverage')
+ self.cover_html_dir = os.path.join(os.getcwd(), 'cover')
+ if os.path.exists(self.cover_file):
+ os.unlink(self.cover_file)
+ if os.path.exists(self.cover_html_dir):
+ shutil.rmtree(self.cover_html_dir)
+ self.assertRaises(SystemExit,
+ super(TestCoverageMinPercentagePlugin, self).setUp)
+
+ def runTest(self):
+ pass
+
+
+class TestCoverageMinPercentageTOTALPlugin(PluginTester, unittest.TestCase):
+ activate = "--with-coverage"
+ args = ['-v', '--cover-package=blah', '--cover-package=moo',
+ '--cover-min-percentage', '100']
+ plugins = [Coverage()]
+ suitepath = os.path.join(support, 'coverage2')
+
+ def setUp(self):
+ self.cover_file = os.path.join(os.getcwd(), '.coverage')
+ self.cover_html_dir = os.path.join(os.getcwd(), 'cover')
+ if os.path.exists(self.cover_file):
+ os.unlink(self.cover_file)
+ if os.path.exists(self.cover_html_dir):
+ shutil.rmtree(self.cover_html_dir)
+ self.assertRaises(SystemExit,
+ super(TestCoverageMinPercentageTOTALPlugin, self).setUp)
+
+ def runTest(self):
+ pass
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/functional_tests/test_coverage_plugin.pyc b/functional_tests/test_coverage_plugin.pyc
new file mode 100644
index 0000000..b731e73
--- /dev/null
+++ b/functional_tests/test_coverage_plugin.pyc
Binary files differ
diff --git a/functional_tests/test_defaultpluginmanager.py b/functional_tests/test_defaultpluginmanager.py
new file mode 100644
index 0000000..28c1b86
--- /dev/null
+++ b/functional_tests/test_defaultpluginmanager.py
@@ -0,0 +1,22 @@
+import unittest
+from nose.plugins import Plugin
+from nose.plugins.manager import DefaultPluginManager
+
+class OverridesSkip(Plugin):
+ """Plugin to override the built-in Skip"""
+ enabled = True
+ name = 'skip'
+ is_overridden = True
+
+
+class TestDefaultPluginManager(unittest.TestCase):
+
+ def test_extraplugins_override_builtins(self):
+ pm = DefaultPluginManager()
+ pm.addPlugins(extraplugins=[OverridesSkip()])
+ pm.loadPlugins()
+ for plugin in pm.plugins:
+ if plugin.name == "skip":
+ break
+ overridden = getattr(plugin, 'is_overridden', False)
+ self.assertTrue(overridden)
diff --git a/functional_tests/test_defaultpluginmanager.pyc b/functional_tests/test_defaultpluginmanager.pyc
new file mode 100644
index 0000000..a73f080
--- /dev/null
+++ b/functional_tests/test_defaultpluginmanager.pyc
Binary files differ
diff --git a/functional_tests/test_doctest_plugin.pyc b/functional_tests/test_doctest_plugin.pyc
new file mode 100644
index 0000000..714f557
--- /dev/null
+++ b/functional_tests/test_doctest_plugin.pyc
Binary files differ
diff --git a/functional_tests/test_entrypoints.pyc b/functional_tests/test_entrypoints.pyc
new file mode 100644
index 0000000..239c7b5
--- /dev/null
+++ b/functional_tests/test_entrypoints.pyc
Binary files differ
diff --git a/functional_tests/test_failuredetail_plugin.pyc b/functional_tests/test_failuredetail_plugin.pyc
new file mode 100644
index 0000000..2d78dd9
--- /dev/null
+++ b/functional_tests/test_failuredetail_plugin.pyc
Binary files differ
diff --git a/functional_tests/test_generator_fixtures.pyc b/functional_tests/test_generator_fixtures.pyc
new file mode 100644
index 0000000..3e69ef2
--- /dev/null
+++ b/functional_tests/test_generator_fixtures.pyc
Binary files differ
diff --git a/functional_tests/test_id_plugin.pyc b/functional_tests/test_id_plugin.pyc
new file mode 100644
index 0000000..8d1d349
--- /dev/null
+++ b/functional_tests/test_id_plugin.pyc
Binary files differ
diff --git a/functional_tests/test_importer.pyc b/functional_tests/test_importer.pyc
new file mode 100644
index 0000000..f9d1147
--- /dev/null
+++ b/functional_tests/test_importer.pyc
Binary files differ
diff --git a/functional_tests/test_isolate_plugin.pyc b/functional_tests/test_isolate_plugin.pyc
new file mode 100644
index 0000000..93d9b94
--- /dev/null
+++ b/functional_tests/test_isolate_plugin.pyc
Binary files differ
diff --git a/functional_tests/test_issue120/support/some_test.pyc b/functional_tests/test_issue120/support/some_test.pyc
new file mode 100644
index 0000000..2a48d98
--- /dev/null
+++ b/functional_tests/test_issue120/support/some_test.pyc
Binary files differ
diff --git a/functional_tests/test_issue_072.pyc b/functional_tests/test_issue_072.pyc
new file mode 100644
index 0000000..cbf9e4e
--- /dev/null
+++ b/functional_tests/test_issue_072.pyc
Binary files differ
diff --git a/functional_tests/test_issue_082.pyc b/functional_tests/test_issue_082.pyc
new file mode 100644
index 0000000..66bd500
--- /dev/null
+++ b/functional_tests/test_issue_082.pyc
Binary files differ
diff --git a/functional_tests/test_issue_408.py b/functional_tests/test_issue_408.py
new file mode 100644
index 0000000..17ea65c
--- /dev/null
+++ b/functional_tests/test_issue_408.py
@@ -0,0 +1,25 @@
+import os
+import unittest
+
+from nose.plugins import Plugin, PluginTester
+#from nose.plugins.builtin import FailureDetail, Capture, Doctest
+
+support = os.path.join(os.path.dirname(__file__), 'support', 'issue408')
+
+class TestIssue408(PluginTester, unittest.TestCase):
+ args = ['--where='+support, 'test:testa.test1', 'test:testa.test2', 'test:testb.test1', 'test:testb.test2']
+ activate = "-v"
+
+ def makeSuite(self):
+ # make PluginTester happy, because we don't specify suitepath, we
+ # have to implement this function
+ return None
+
+ def test_no_failure(self):
+ output = str(self.output)
+ assert 'FAIL:' not in output
+ assert 'AssertionError' not in output
+ assert 'OK' in output
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/functional_tests/test_issue_408.pyc b/functional_tests/test_issue_408.pyc
new file mode 100644
index 0000000..2803ff7
--- /dev/null
+++ b/functional_tests/test_issue_408.pyc
Binary files differ
diff --git a/functional_tests/test_load_tests_from_test_case.pyc b/functional_tests/test_load_tests_from_test_case.pyc
new file mode 100644
index 0000000..5885760
--- /dev/null
+++ b/functional_tests/test_load_tests_from_test_case.pyc
Binary files differ
diff --git a/functional_tests/test_loader.pyc b/functional_tests/test_loader.pyc
new file mode 100644
index 0000000..5f4a203
--- /dev/null
+++ b/functional_tests/test_loader.pyc
Binary files differ
diff --git a/functional_tests/test_multiprocessing/__init__.py b/functional_tests/test_multiprocessing/__init__.py
new file mode 100644
index 0000000..2a52efd
--- /dev/null
+++ b/functional_tests/test_multiprocessing/__init__.py
@@ -0,0 +1,28 @@
+import os
+from unittest import TestCase
+
+from nose.plugins import PluginTester
+from nose.plugins.skip import SkipTest
+from nose.plugins.multiprocess import MultiProcess
+
+support = os.path.join(os.path.dirname(__file__), 'support')
+
+def setup():
+ try:
+ import multiprocessing
+ if 'active' in MultiProcess.status:
+ raise SkipTest("Multiprocess plugin is active. Skipping tests of "
+ "plugin itself.")
+ except ImportError:
+ raise SkipTest("multiprocessing module not available")
+
+class MPTestBase(PluginTester, TestCase):
+ processes = 1
+ activate = '--processes=1'
+ plugins = [MultiProcess()]
+ suitepath = os.path.join(support, 'timeout.py')
+
+ def __init__(self, *args, **kwargs):
+ self.activate = '--processes=%d' % self.processes
+ PluginTester.__init__(self)
+ TestCase.__init__(self, *args, **kwargs)
diff --git a/functional_tests/test_multiprocessing/__init__.pyc b/functional_tests/test_multiprocessing/__init__.pyc
new file mode 100644
index 0000000..3e924ee
--- /dev/null
+++ b/functional_tests/test_multiprocessing/__init__.pyc
Binary files differ
diff --git a/functional_tests/test_multiprocessing/support/class.py b/functional_tests/test_multiprocessing/support/class.py
new file mode 100644
index 0000000..905bcdf
--- /dev/null
+++ b/functional_tests/test_multiprocessing/support/class.py
@@ -0,0 +1,14 @@
+class TestFunctionalTest(object):
+ counter = 0
+ @classmethod
+ def setup_class(cls):
+ cls.counter += 1
+ @classmethod
+ def teardown_class(cls):
+ cls.counter -= 1
+ def _run(self):
+ assert self.counter==1
+ def test1(self):
+ self._run()
+ def test2(self):
+ self._run()
diff --git a/functional_tests/test_multiprocessing/support/class.pyc b/functional_tests/test_multiprocessing/support/class.pyc
new file mode 100644
index 0000000..a58cec4
--- /dev/null
+++ b/functional_tests/test_multiprocessing/support/class.pyc
Binary files differ
diff --git a/functional_tests/test_multiprocessing/support/concurrent_shared/__init__.py b/functional_tests/test_multiprocessing/support/concurrent_shared/__init__.py
new file mode 100644
index 0000000..c557001
--- /dev/null
+++ b/functional_tests/test_multiprocessing/support/concurrent_shared/__init__.py
@@ -0,0 +1,6 @@
+counter=[0]
+_multiprocess_shared_ = True
+def setup_package():
+ counter[0] += 1
+def teardown_package():
+ counter[0] -= 1
diff --git a/functional_tests/test_multiprocessing/support/concurrent_shared/__init__.pyc b/functional_tests/test_multiprocessing/support/concurrent_shared/__init__.pyc
new file mode 100644
index 0000000..9218290
--- /dev/null
+++ b/functional_tests/test_multiprocessing/support/concurrent_shared/__init__.pyc
Binary files differ
diff --git a/functional_tests/test_multiprocessing/support/concurrent_shared/test.py b/functional_tests/test_multiprocessing/support/concurrent_shared/test.py
new file mode 100644
index 0000000..5bc21f6
--- /dev/null
+++ b/functional_tests/test_multiprocessing/support/concurrent_shared/test.py
@@ -0,0 +1,11 @@
+#from . import counter
+from time import sleep
+#_multiprocess_can_split_ = True
+class Test1(object):
+ def test1(self):
+ sleep(1)
+ pass
+class Test2(object):
+ def test2(self):
+ sleep(1)
+ pass
diff --git a/functional_tests/test_multiprocessing/support/concurrent_shared/test.pyc b/functional_tests/test_multiprocessing/support/concurrent_shared/test.pyc
new file mode 100644
index 0000000..eaa9880
--- /dev/null
+++ b/functional_tests/test_multiprocessing/support/concurrent_shared/test.pyc
Binary files differ
diff --git a/functional_tests/test_multiprocessing/support/fake_nosetest.py b/functional_tests/test_multiprocessing/support/fake_nosetest.py
new file mode 100644
index 0000000..f5a6289
--- /dev/null
+++ b/functional_tests/test_multiprocessing/support/fake_nosetest.py
@@ -0,0 +1,14 @@
+import os
+import sys
+
+import nose
+from nose.plugins.multiprocess import MultiProcess
+from nose.config import Config
+from nose.plugins.manager import PluginManager
+
+if __name__ == '__main__':
+ if len(sys.argv) < 3:
+ print "USAGE: %s TEST_FILE LOG_FILE" % sys.argv[0]
+ sys.exit(1)
+ os.environ['NOSE_MP_LOG']=sys.argv[2]
+ nose.main(defaultTest=sys.argv[1], argv=[sys.argv[0],'--processes=1','-v'], config=Config(plugins=PluginManager(plugins=[MultiProcess()])))
diff --git a/functional_tests/test_multiprocessing/support/keyboardinterrupt.py b/functional_tests/test_multiprocessing/support/keyboardinterrupt.py
new file mode 100644
index 0000000..2c36d95
--- /dev/null
+++ b/functional_tests/test_multiprocessing/support/keyboardinterrupt.py
@@ -0,0 +1,29 @@
+import os
+
+from tempfile import mktemp
+from time import sleep
+
+if 'NOSE_MP_LOG' not in os.environ:
+ raise Exception('Environment variable NOSE_MP_LOG is not set')
+
+logfile = os.environ['NOSE_MP_LOG']
+
+def log(w):
+ f = open(logfile, 'a')
+ f.write(w+"\n")
+ f.close()
+#make sure all tests in this file are dispatched to the same subprocess
+def setup():
+ log('setup')
+
+def test_timeout():
+ log('test_timeout')
+ sleep(2)
+ log('test_timeout_finished')
+
+# check timeout will not prevent remaining tests dispatched to the same subprocess to continue to run
+def test_pass():
+ log('test_pass')
+
+def teardown():
+ log('teardown')
diff --git a/functional_tests/test_multiprocessing/support/keyboardinterrupt.pyc b/functional_tests/test_multiprocessing/support/keyboardinterrupt.pyc
new file mode 100644
index 0000000..0c1dd85
--- /dev/null
+++ b/functional_tests/test_multiprocessing/support/keyboardinterrupt.pyc
Binary files differ
diff --git a/functional_tests/test_multiprocessing/support/keyboardinterrupt_twice.py b/functional_tests/test_multiprocessing/support/keyboardinterrupt_twice.py
new file mode 100644
index 0000000..3932bbd
--- /dev/null
+++ b/functional_tests/test_multiprocessing/support/keyboardinterrupt_twice.py
@@ -0,0 +1,34 @@
+import os
+
+from tempfile import mktemp
+from time import sleep
+
+if 'NOSE_MP_LOG' not in os.environ:
+ raise Exception('Environment variable NOSE_MP_LOG is not set')
+
+logfile = os.environ['NOSE_MP_LOG']
+
+def log(w):
+ f = open(logfile, 'a')
+ f.write(w+"\n")
+ f.close()
+#make sure all tests in this file are dispatched to the same subprocess
+def setup():
+ '''global logfile
+ logfile = mktemp()
+ print "tempfile is:",logfile'''
+ log('setup')
+
+def test_timeout():
+ log('test_timeout')
+ sleep(2)
+ log('test_timeout_finished')
+
+# check timeout will not prevent remaining tests dispatched to the same subprocess to continue to run
+def test_pass():
+ log('test_pass')
+
+def teardown():
+ log('teardown')
+ sleep(10)
+ log('teardown_finished')
diff --git a/functional_tests/test_multiprocessing/support/keyboardinterrupt_twice.pyc b/functional_tests/test_multiprocessing/support/keyboardinterrupt_twice.pyc
new file mode 100644
index 0000000..7444e51
--- /dev/null
+++ b/functional_tests/test_multiprocessing/support/keyboardinterrupt_twice.pyc
Binary files differ
diff --git a/functional_tests/test_multiprocessing/support/nameerror.py b/functional_tests/test_multiprocessing/support/nameerror.py
new file mode 100644
index 0000000..20e7bd7
--- /dev/null
+++ b/functional_tests/test_multiprocessing/support/nameerror.py
@@ -0,0 +1,4 @@
+# we purposefully raise a NameError at the top level here
+
+undefined_variable
+
diff --git a/functional_tests/test_multiprocessing/support/nameerror.pyc b/functional_tests/test_multiprocessing/support/nameerror.pyc
new file mode 100644
index 0000000..04a04a9
--- /dev/null
+++ b/functional_tests/test_multiprocessing/support/nameerror.pyc
Binary files differ
diff --git a/functional_tests/test_multiprocessing/support/timeout.py b/functional_tests/test_multiprocessing/support/timeout.py
new file mode 100644
index 0000000..480c859
--- /dev/null
+++ b/functional_tests/test_multiprocessing/support/timeout.py
@@ -0,0 +1,12 @@
+#make sure all tests in this file are dispatched to the same subprocess
+def setup():
+ pass
+
+def test_timeout():
+ "this test *should* fail when process-timeout=1"
+ from time import sleep
+ sleep(2)
+
+# check timeout will not prevent remaining tests dispatched to the same subprocess to continue to run
+def test_pass():
+ pass
diff --git a/functional_tests/test_multiprocessing/support/timeout.pyc b/functional_tests/test_multiprocessing/support/timeout.pyc
new file mode 100644
index 0000000..c53fc3b
--- /dev/null
+++ b/functional_tests/test_multiprocessing/support/timeout.pyc
Binary files differ
diff --git a/functional_tests/test_multiprocessing/test_class.py b/functional_tests/test_multiprocessing/test_class.py
new file mode 100644
index 0000000..d92710d
--- /dev/null
+++ b/functional_tests/test_multiprocessing/test_class.py
@@ -0,0 +1,13 @@
+import os
+
+from test_multiprocessing import MPTestBase
+
+
+#test case for #462
+class TestClassFixture(MPTestBase):
+ suitepath = os.path.join(os.path.dirname(__file__), 'support', 'class.py')
+
+ def runTest(self):
+ assert str(self.output).strip().endswith('OK')
+ assert 'Ran 2 tests' in self.output
+
diff --git a/functional_tests/test_multiprocessing/test_class.pyc b/functional_tests/test_multiprocessing/test_class.pyc
new file mode 100644
index 0000000..652490f
--- /dev/null
+++ b/functional_tests/test_multiprocessing/test_class.pyc
Binary files differ
diff --git a/functional_tests/test_multiprocessing/test_concurrent_shared.py b/functional_tests/test_multiprocessing/test_concurrent_shared.py
new file mode 100644
index 0000000..2552c2b
--- /dev/null
+++ b/functional_tests/test_multiprocessing/test_concurrent_shared.py
@@ -0,0 +1,13 @@
+import os
+
+from test_multiprocessing import MPTestBase
+
+class TestConcurrentShared(MPTestBase):
+ processes = 2
+ suitepath = os.path.join(os.path.dirname(__file__), 'support',
+ 'concurrent_shared')
+
+ def runTest(self):
+ assert 'Ran 2 tests in 1.' in self.output, "make sure two tests use 1.x seconds (no more than 2 seconsd)"
+ assert str(self.output).strip().endswith('OK')
+
diff --git a/functional_tests/test_multiprocessing/test_concurrent_shared.pyc b/functional_tests/test_multiprocessing/test_concurrent_shared.pyc
new file mode 100644
index 0000000..bf83a64
--- /dev/null
+++ b/functional_tests/test_multiprocessing/test_concurrent_shared.pyc
Binary files differ
diff --git a/functional_tests/test_multiprocessing/test_keyboardinterrupt.py b/functional_tests/test_multiprocessing/test_keyboardinterrupt.py
new file mode 100644
index 0000000..8f07e54
--- /dev/null
+++ b/functional_tests/test_multiprocessing/test_keyboardinterrupt.py
@@ -0,0 +1,84 @@
+from subprocess import Popen,PIPE
+import os
+import sys
+from time import sleep
+import signal
+
+import nose
+
+support = os.path.join(os.path.dirname(__file__), 'support')
+
+PYTHONPATH = os.environ['PYTHONPATH'] if 'PYTHONPATH' in os.environ else ''
+def setup():
+ nose_parent_dir = os.path.normpath(os.path.join(os.path.abspath(os.path.dirname(nose.__file__)),'..'))
+ paths = [nose_parent_dir]
+ if PYTHONPATH:
+ paths.append(PYTHONPATH)
+ os.environ['PYTHONPATH'] = os.pathsep.join(paths)
+def teardown():
+ if PYTHONPATH:
+ os.environ['PYTHONPATH'] = PYTHONPATH
+ else:
+ del os.environ['PYTHONPATH']
+
+runner = os.path.join(support, 'fake_nosetest.py')
+def keyboardinterrupt(case):
+ #os.setsid would create a process group so signals sent to the
+ #parent process will propogates to all children processes
+ from tempfile import mktemp
+ logfile = mktemp()
+ process = Popen([sys.executable,runner,os.path.join(support,case),logfile], preexec_fn=os.setsid, stdout=PIPE, stderr=PIPE, bufsize=-1)
+
+ #wait until logfile is created:
+ retry=100
+ while not os.path.exists(logfile):
+ sleep(0.1)
+ retry -= 1
+ if not retry:
+ raise Exception('Timeout while waiting for log file to be created by fake_nosetest.py')
+
+ os.killpg(process.pid, signal.SIGINT)
+ return process, logfile
+
+def get_log_content(logfile):
+ '''prefix = 'tempfile is: '
+ if not stdout.startswith(prefix):
+ raise Exception('stdout does not contain tmp file name: '+stdout)
+ logfile = stdout[len(prefix):].strip() #remove trailing new line char'''
+ f = open(logfile)
+ content = f.read()
+ f.close()
+ os.remove(logfile)
+ return content
+
+def test_keyboardinterrupt():
+ process, logfile = keyboardinterrupt('keyboardinterrupt.py')
+ stdout, stderr = [s.decode('utf-8') for s in process.communicate(None)]
+ print stderr
+ log = get_log_content(logfile)
+ assert 'setup' in log
+ assert 'test_timeout' in log
+ assert 'test_timeout_finished' not in log
+ assert 'test_pass' not in log
+ assert 'teardown' in log
+ assert 'Ran 0 tests' in stderr
+ assert 'KeyboardInterrupt' in stderr
+ assert 'FAILED (errors=1)' in stderr
+ assert 'ERROR: Worker 0 keyboard interrupt, failing current test '+os.path.join(support,'keyboardinterrupt.py') in stderr
+
+
+def test_keyboardinterrupt_twice():
+ process, logfile = keyboardinterrupt('keyboardinterrupt_twice.py')
+ sleep(0.5)
+ os.killpg(process.pid, signal.SIGINT)
+ stdout, stderr = [s.decode('utf-8') for s in process.communicate(None)]
+ log = get_log_content(logfile)
+ assert 'setup' in log
+ assert 'test_timeout' in log
+ assert 'test_timeout_finished' not in log
+ assert 'test_pass' not in log
+ assert 'teardown' in log
+ assert 'teardown_finished' not in log
+ assert 'Ran 0 tests' in stderr
+ assert 'KeyboardInterrupt' in stderr
+ assert 'FAILED (errors=1)' in stderr
diff --git a/functional_tests/test_multiprocessing/test_keyboardinterrupt.pyc b/functional_tests/test_multiprocessing/test_keyboardinterrupt.pyc
new file mode 100644
index 0000000..a40b2e7
--- /dev/null
+++ b/functional_tests/test_multiprocessing/test_keyboardinterrupt.pyc
Binary files differ
diff --git a/functional_tests/test_multiprocessing/test_nameerror.py b/functional_tests/test_multiprocessing/test_nameerror.py
new file mode 100644
index 0000000..5e58226
--- /dev/null
+++ b/functional_tests/test_multiprocessing/test_nameerror.py
@@ -0,0 +1,13 @@
+import os
+
+from test_multiprocessing import support, MPTestBase
+
+class TestMPNameError(MPTestBase):
+ processes = 2
+ suitepath = os.path.join(os.path.dirname(__file__), 'support', 'nameerror.py')
+
+ def runTest(self):
+ print str(self.output)
+ assert 'NameError' in self.output
+ assert "'undefined_variable' is not defined" in self.output
+
diff --git a/functional_tests/test_multiprocessing/test_nameerror.pyc b/functional_tests/test_multiprocessing/test_nameerror.pyc
new file mode 100644
index 0000000..2d5732b
--- /dev/null
+++ b/functional_tests/test_multiprocessing/test_nameerror.pyc
Binary files differ
diff --git a/functional_tests/test_multiprocessing/test_process_timeout.py b/functional_tests/test_multiprocessing/test_process_timeout.py
new file mode 100644
index 0000000..6b858f8
--- /dev/null
+++ b/functional_tests/test_multiprocessing/test_process_timeout.py
@@ -0,0 +1,21 @@
+import os
+
+from test_multiprocessing import MPTestBase
+
+class TestMPTimeout(MPTestBase):
+ args = ['--process-timeout=1']
+ suitepath = os.path.join(os.path.dirname(__file__), 'support', 'timeout.py')
+
+ def runTest(self):
+ assert "TimedOutException: 'timeout.test_timeout'" in self.output
+ assert "Ran 2 tests in" in self.output
+ assert "FAILED (errors=1)" in self.output
+
+class TestMPTimeoutPass(TestMPTimeout):
+ args = ['--process-timeout=3']
+
+ def runTest(self):
+ assert "TimedOutException: 'timeout.test_timeout'" not in self.output
+ assert "Ran 2 tests in" in self.output
+ assert str(self.output).strip().endswith('OK')
+
diff --git a/functional_tests/test_multiprocessing/test_process_timeout.pyc b/functional_tests/test_multiprocessing/test_process_timeout.pyc
new file mode 100644
index 0000000..30bbf65
--- /dev/null
+++ b/functional_tests/test_multiprocessing/test_process_timeout.pyc
Binary files differ
diff --git a/functional_tests/test_namespace_pkg.pyc b/functional_tests/test_namespace_pkg.pyc
new file mode 100644
index 0000000..bf7634b
--- /dev/null
+++ b/functional_tests/test_namespace_pkg.pyc
Binary files differ
diff --git a/functional_tests/test_plugin_api.pyc b/functional_tests/test_plugin_api.pyc
new file mode 100644
index 0000000..a790585
--- /dev/null
+++ b/functional_tests/test_plugin_api.pyc
Binary files differ
diff --git a/functional_tests/test_plugins.pyc b/functional_tests/test_plugins.pyc
new file mode 100644
index 0000000..edd721e
--- /dev/null
+++ b/functional_tests/test_plugins.pyc
Binary files differ
diff --git a/functional_tests/test_plugintest.pyc b/functional_tests/test_plugintest.pyc
new file mode 100644
index 0000000..0cd6400
--- /dev/null
+++ b/functional_tests/test_plugintest.pyc
Binary files differ
diff --git a/functional_tests/test_program.pyc b/functional_tests/test_program.pyc
new file mode 100644
index 0000000..dafa056
--- /dev/null
+++ b/functional_tests/test_program.pyc
Binary files differ
diff --git a/functional_tests/test_result.pyc b/functional_tests/test_result.pyc
new file mode 100644
index 0000000..c8d8810
--- /dev/null
+++ b/functional_tests/test_result.pyc
Binary files differ
diff --git a/functional_tests/test_selector.pyc b/functional_tests/test_selector.pyc
new file mode 100644
index 0000000..03b8f54
--- /dev/null
+++ b/functional_tests/test_selector.pyc
Binary files differ
diff --git a/functional_tests/test_skip_pdb_interaction.pyc b/functional_tests/test_skip_pdb_interaction.pyc
new file mode 100644
index 0000000..e53d79b
--- /dev/null
+++ b/functional_tests/test_skip_pdb_interaction.pyc
Binary files differ
diff --git a/functional_tests/test_success.pyc b/functional_tests/test_success.pyc
new file mode 100644
index 0000000..cbc564d
--- /dev/null
+++ b/functional_tests/test_success.pyc
Binary files differ
diff --git a/functional_tests/test_suite.pyc b/functional_tests/test_suite.pyc
new file mode 100644
index 0000000..3e5af98
--- /dev/null
+++ b/functional_tests/test_suite.pyc
Binary files differ
diff --git a/functional_tests/test_xunit.pyc b/functional_tests/test_xunit.pyc
new file mode 100644
index 0000000..15c1a36
--- /dev/null
+++ b/functional_tests/test_xunit.pyc
Binary files differ
diff --git a/nose/pyversion.py b/nose/pyversion.py
new file mode 100644
index 0000000..36ddcfd
--- /dev/null
+++ b/nose/pyversion.py
@@ -0,0 +1,130 @@
+"""
+This module contains fixups for using nose under different versions of Python.
+"""
+import sys
+import os
+import types
+import inspect
+import nose.util
+
+__all__ = ['make_instancemethod', 'cmp_to_key', 'sort_list', 'ClassType',
+ 'TypeType', 'UNICODE_STRINGS', 'unbound_method', 'ismethod',
+ 'bytes_']
+
+# In Python 3.x, all strings are unicode (the call to 'unicode()' in the 2.x
+# source will be replaced with 'str()' when running 2to3, so this test will
+# then become true)
+UNICODE_STRINGS = (type(unicode()) == type(str()))
+
+# new.instancemethod() is obsolete for new-style classes (Python 3.x)
+# We need to use descriptor methods instead.
+try:
+ import new
+ def make_instancemethod(function, instance):
+ return new.instancemethod(function.im_func, instance,
+ instance.__class__)
+except ImportError:
+ def make_instancemethod(function, instance):
+ return function.__get__(instance, instance.__class__)
+
+# To be forward-compatible, we do all list sorts using keys instead of cmp
+# functions. However, part of the unittest.TestLoader API involves a
+# user-provideable cmp function, so we need some way to convert that.
+def cmp_to_key(mycmp):
+ 'Convert a cmp= function into a key= function'
+ class Key(object):
+ def __init__(self, obj):
+ self.obj = obj
+ def __lt__(self, other):
+ return mycmp(self.obj, other.obj) < 0
+ def __gt__(self, other):
+ return mycmp(self.obj, other.obj) > 0
+ def __eq__(self, other):
+ return mycmp(self.obj, other.obj) == 0
+ return Key
+
+# Python 2.3 also does not support list-sorting by key, so we need to convert
+# keys to cmp functions if we're running on old Python..
+if sys.version_info < (2, 4):
+ def sort_list(l, key, reverse=False):
+ if reverse:
+ return l.sort(lambda a, b: cmp(key(b), key(a)))
+ else:
+ return l.sort(lambda a, b: cmp(key(a), key(b)))
+else:
+ def sort_list(l, key, reverse=False):
+ return l.sort(key=key, reverse=reverse)
+
+# In Python 3.x, all objects are "new style" objects descended from 'type', and
+# thus types.ClassType and types.TypeType don't exist anymore. For
+# compatibility, we make sure they still work.
+if hasattr(types, 'ClassType'):
+ ClassType = types.ClassType
+ TypeType = types.TypeType
+else:
+ ClassType = type
+ TypeType = type
+
+# The following emulates the behavior (we need) of an 'unbound method' under
+# Python 3.x (namely, the ability to have a class associated with a function
+# definition so that things can do stuff based on its associated class)
+class UnboundMethod:
+ def __init__(self, cls, func):
+ # Make sure we have all the same attributes as the original function,
+ # so that the AttributeSelector plugin will work correctly...
+ self.__dict__ = func.__dict__.copy()
+ self._func = func
+ self.__self__ = UnboundSelf(cls)
+
+ def address(self):
+ cls = self.__self__.cls
+ modname = cls.__module__
+ module = sys.modules[modname]
+ filename = getattr(module, '__file__', None)
+ if filename is not None:
+ filename = os.path.abspath(filename)
+ return (nose.util.src(filename), modname, "%s.%s" % (cls.__name__,
+ self._func.__name__))
+
+ def __call__(self, *args, **kwargs):
+ return self._func(*args, **kwargs)
+
+ def __getattr__(self, attr):
+ return getattr(self._func, attr)
+
+ def __repr__(self):
+ return '<unbound method %s.%s>' % (self.__self__.cls.__name__,
+ self._func.__name__)
+
+class UnboundSelf:
+ def __init__(self, cls):
+ self.cls = cls
+
+ # We have to do this hackery because Python won't let us override the
+ # __class__ attribute...
+ def __getattribute__(self, attr):
+ if attr == '__class__':
+ return self.cls
+ else:
+ return object.__getattribute__(self, attr)
+
+def unbound_method(cls, func):
+ if inspect.ismethod(func):
+ return func
+ if not inspect.isfunction(func):
+ raise TypeError('%s is not a function' % (repr(func),))
+ return UnboundMethod(cls, func)
+
+def ismethod(obj):
+ return inspect.ismethod(obj) or isinstance(obj, UnboundMethod)
+
+
+# Make a pseudo-bytes function that can be called without the encoding arg:
+if sys.version_info >= (3, 0):
+ def bytes_(s, encoding='utf8'):
+ if isinstance(s, bytes):
+ return s
+ return bytes(s, encoding)
+else:
+ def bytes_(s, encoding=None):
+ return str(s)
diff --git a/nose/tools/__init__.py b/nose/tools/__init__.py
new file mode 100644
index 0000000..ba32301
--- /dev/null
+++ b/nose/tools/__init__.py
@@ -0,0 +1,11 @@
+"""
+Tools for testing
+-----------------
+
+nose.tools provides a few convenience functions to make writing tests
+easier. You don't have to use them; nothing in the rest of nose depends
+on any of these methods.
+
+"""
+from nose.tools.nontrivial import *
+from nose.tools.trivial import *
diff --git a/nose/tools/nontrivial.py b/nose/tools/nontrivial.py
new file mode 100644
index 0000000..e47ac62
--- /dev/null
+++ b/nose/tools/nontrivial.py
@@ -0,0 +1,150 @@
+"""Tools not exempt from being descended into in tracebacks"""
+
+import time
+
+
+__all__ = ['make_decorator', 'raises', 'set_trace', 'timed', 'with_setup',
+ 'TimeExpired', 'istest', 'nottest']
+
+
+class TimeExpired(AssertionError):
+ pass
+
+
+def make_decorator(func):
+ """
+ Wraps a test decorator so as to properly replicate metadata
+ of the decorated function, including nose's additional stuff
+ (namely, setup and teardown).
+ """
+ def decorate(newfunc):
+ if hasattr(func, 'compat_func_name'):
+ name = func.compat_func_name
+ else:
+ name = func.__name__
+ newfunc.__dict__ = func.__dict__
+ newfunc.__doc__ = func.__doc__
+ newfunc.__module__ = func.__module__
+ if not hasattr(newfunc, 'compat_co_firstlineno'):
+ newfunc.compat_co_firstlineno = func.func_code.co_firstlineno
+ try:
+ newfunc.__name__ = name
+ except TypeError:
+ # can't set func name in 2.3
+ newfunc.compat_func_name = name
+ return newfunc
+ return decorate
+
+
+def raises(*exceptions):
+ """Test must raise one of expected exceptions to pass.
+
+ Example use::
+
+ @raises(TypeError, ValueError)
+ def test_raises_type_error():
+ raise TypeError("This test passes")
+
+ @raises(Exception)
+ def test_that_fails_by_passing():
+ pass
+
+ If you want to test many assertions about exceptions in a single test,
+ you may want to use `assert_raises` instead.
+ """
+ valid = ' or '.join([e.__name__ for e in exceptions])
+ def decorate(func):
+ name = func.__name__
+ def newfunc(*arg, **kw):
+ try:
+ func(*arg, **kw)
+ except exceptions:
+ pass
+ except:
+ raise
+ else:
+ message = "%s() did not raise %s" % (name, valid)
+ raise AssertionError(message)
+ newfunc = make_decorator(func)(newfunc)
+ return newfunc
+ return decorate
+
+
+def set_trace():
+ """Call pdb.set_trace in the calling frame, first restoring
+ sys.stdout to the real output stream. Note that sys.stdout is NOT
+ reset to whatever it was before the call once pdb is done!
+ """
+ import pdb
+ import sys
+ stdout = sys.stdout
+ sys.stdout = sys.__stdout__
+ pdb.Pdb().set_trace(sys._getframe().f_back)
+
+
+def timed(limit):
+ """Test must finish within specified time limit to pass.
+
+ Example use::
+
+ @timed(.1)
+ def test_that_fails():
+ time.sleep(.2)
+ """
+ def decorate(func):
+ def newfunc(*arg, **kw):
+ start = time.time()
+ func(*arg, **kw)
+ end = time.time()
+ if end - start > limit:
+ raise TimeExpired("Time limit (%s) exceeded" % limit)
+ newfunc = make_decorator(func)(newfunc)
+ return newfunc
+ return decorate
+
+
+def with_setup(setup=None, teardown=None):
+ """Decorator to add setup and/or teardown methods to a test function::
+
+ @with_setup(setup, teardown)
+ def test_something():
+ " ... "
+
+ Note that `with_setup` is useful *only* for test functions, not for test
+ methods or inside of TestCase subclasses.
+ """
+ def decorate(func, setup=setup, teardown=teardown):
+ if setup:
+ if hasattr(func, 'setup'):
+ _old_s = func.setup
+ def _s():
+ setup()
+ _old_s()
+ func.setup = _s
+ else:
+ func.setup = setup
+ if teardown:
+ if hasattr(func, 'teardown'):
+ _old_t = func.teardown
+ def _t():
+ _old_t()
+ teardown()
+ func.teardown = _t
+ else:
+ func.teardown = teardown
+ return func
+ return decorate
+
+
+def istest(func):
+ """Decorator to mark a function or method as a test
+ """
+ func.__test__ = True
+ return func
+
+
+def nottest(func):
+ """Decorator to mark a function or method as *not* a test
+ """
+ func.__test__ = False
+ return func
diff --git a/nose/tools/trivial.py b/nose/tools/trivial.py
new file mode 100644
index 0000000..cf83efe
--- /dev/null
+++ b/nose/tools/trivial.py
@@ -0,0 +1,54 @@
+"""Tools so trivial that tracebacks should not descend into them
+
+We define the ``__unittest`` symbol in their module namespace so unittest will
+skip them when printing tracebacks, just as it does for their corresponding
+methods in ``unittest`` proper.
+
+"""
+import re
+import unittest
+
+
+__all__ = ['ok_', 'eq_']
+
+# Use the same flag as unittest itself to prevent descent into these functions:
+__unittest = 1
+
+
+def ok_(expr, msg=None):
+ """Shorthand for assert. Saves 3 whole characters!
+ """
+ if not expr:
+ raise AssertionError(msg)
+
+
+def eq_(a, b, msg=None):
+ """Shorthand for 'assert a == b, "%r != %r" % (a, b)
+ """
+ if not a == b:
+ raise AssertionError(msg or "%r != %r" % (a, b))
+
+
+#
+# Expose assert* from unittest.TestCase
+# - give them pep8 style names
+#
+caps = re.compile('([A-Z])')
+
+def pep8(name):
+ return caps.sub(lambda m: '_' + m.groups()[0].lower(), name)
+
+class Dummy(unittest.TestCase):
+ def nop():
+ pass
+_t = Dummy('nop')
+
+for at in [ at for at in dir(_t)
+ if at.startswith('assert') and not '_' in at ]:
+ pepd = pep8(at)
+ vars()[pepd] = getattr(_t, at)
+ __all__.append(pepd)
+
+del Dummy
+del _t
+del pep8
diff --git a/patch.py b/patch.py
new file mode 100644
index 0000000..981097c
--- /dev/null
+++ b/patch.py
@@ -0,0 +1,639 @@
+""" Patch utility to apply unified diffs
+
+ Brute-force line-by-line non-recursive parsing
+
+ Copyright (c) 2008-2010 anatoly techtonik
+ Available under the terms of MIT license
+
+ NOTE: This version has been patched by Alex Stewart <alex@foogod.com> for
+ Python 3.x support and other misc fixups.
+
+ Project home: http://code.google.com/p/python-patch/
+
+
+ $Id: patch.py 92 2010-07-02 06:04:57Z techtonik $
+ $HeadURL: http://python-patch.googlecode.com/svn/trunk/patch.py $
+"""
+
+__author__ = "techtonik.rainforce.org"
+__version__ = "10.04-2.pAS1"
+
+import copy
+import logging
+import re
+from logging import debug, info, warning
+import sys
+
+try:
+ # cStringIO doesn't support unicode in 2.5
+ from StringIO import StringIO
+except ImportError:
+ # StringIO has been renamed to 'io' in 3.x
+ from io import StringIO
+
+from os.path import exists, isfile, abspath
+from os import unlink
+
+_open = open
+
+if sys.version_info >= (3,):
+ # Open files with universal newline support but no newline translation (3.x)
+ def open(filename, mode='r'):
+ return _open(filename, mode, newline='')
+else:
+ # Open files with universal newline support but no newline translation (2.x)
+ def open(filename, mode='r'):
+ return _open(filename, mode + 'b')
+
+ # Python 3.x has changed iter.next() to be next(iter) instead, so for
+ # backwards compatibility, we'll just define a next() function under 2.x
+ def next(iter):
+ return iter.next()
+
+
+#------------------------------------------------
+# Logging is controlled by "python_patch" logger
+
+debugmode = False
+
+logger = logging.getLogger("python_patch")
+loghandler = logging.StreamHandler()
+logger.addHandler(loghandler)
+
+debug = logger.debug
+info = logger.info
+warning = logger.warning
+
+# If called as a library, don't log info/debug messages by default.
+logger.setLevel(logging.WARN)
+
+#------------------------------------------------
+
+# constants for patch types
+
+DIFF = PLAIN = "plain"
+HG = MERCURIAL = "mercurial"
+SVN = SUBVERSION = "svn"
+
+
+def fromfile(filename):
+ """ Parse patch file and return Patch() object
+ """
+ info("reading patch from file %s" % filename)
+ fp = open(filename, "r")
+ patch = Patch(fp)
+ fp.close()
+ return patch
+
+
+def fromstring(s):
+ """ Parse text string and return Patch() object
+ """
+ return Patch( StringIO(s) )
+
+
+
+class HunkInfo(object):
+ """ Parsed hunk data container (hunk starts with @@ -R +R @@) """
+
+ def __init__(self):
+ self.startsrc=None #: line count starts with 1
+ self.linessrc=None
+ self.starttgt=None
+ self.linestgt=None
+ self.invalid=False
+ self.text=[]
+
+ def copy(self):
+ return copy.copy(self)
+
+# def apply(self, estream):
+# """ write hunk data into enumerable stream
+# return strings one by one until hunk is
+# over
+#
+# enumerable stream are tuples (lineno, line)
+# where lineno starts with 0
+# """
+# pass
+
+
+
+class Patch(object):
+
+ def __init__(self, stream=None):
+
+ # define Patch data members
+ # table with a row for every source file
+
+ #: list of source filenames
+ self.source=None
+ self.target=None
+ #: list of lists of hunks
+ self.hunks=None
+ #: file endings statistics for every hunk
+ self.hunkends=None
+ #: headers for each file
+ self.header=None
+
+ #: patch type - one of constants
+ self.type = None
+
+ if stream:
+ self.parse(stream)
+
+ def copy(self):
+ return copy.copy(self)
+
+ def parse(self, stream):
+ """ parse unified diff """
+ self.header = []
+
+ self.source = []
+ self.target = []
+ self.hunks = []
+ self.hunkends = []
+
+ # define possible file regions that will direct the parser flow
+ headscan = False # scanning header before the patch body
+ filenames = False # lines starting with --- and +++
+
+ hunkhead = False # @@ -R +R @@ sequence
+ hunkbody = False #
+ hunkskip = False # skipping invalid hunk mode
+
+ headscan = True
+ lineends = dict(lf=0, crlf=0, cr=0)
+ nextfileno = 0
+ nexthunkno = 0 #: even if index starts with 0 user messages number hunks from 1
+
+ # hunkinfo holds parsed values, hunkactual - calculated
+ hunkinfo = HunkInfo()
+ hunkactual = dict(linessrc=None, linestgt=None)
+
+
+ fe = enumerate(stream)
+ for lineno, line in fe:
+
+ # read out header
+ if headscan:
+ header = ''
+ try:
+ while not line.startswith("--- "):
+ header += line
+ lineno, line = next(fe)
+ except StopIteration:
+ # this is actually a loop exit
+ continue
+ self.header.append(header)
+
+ headscan = False
+ # switch to filenames state
+ filenames = True
+
+ # hunkskip and hunkbody code skipped until definition of hunkhead is parsed
+ if hunkbody:
+ # process line first
+ if re.match(r"^[- \+\\]", line):
+ # gather stats about line endings
+ if line.endswith("\r\n"):
+ self.hunkends[nextfileno-1]["crlf"] += 1
+ elif line.endswith("\n"):
+ self.hunkends[nextfileno-1]["lf"] += 1
+ elif line.endswith("\r"):
+ self.hunkends[nextfileno-1]["cr"] += 1
+
+ if line.startswith("-"):
+ hunkactual["linessrc"] += 1
+ elif line.startswith("+"):
+ hunkactual["linestgt"] += 1
+ elif not line.startswith("\\"):
+ hunkactual["linessrc"] += 1
+ hunkactual["linestgt"] += 1
+ hunkinfo.text.append(line)
+ # todo: handle \ No newline cases
+ else:
+ warning("invalid hunk no.%d at %d for target file %s" % (nexthunkno, lineno+1, self.target[nextfileno-1]))
+ # add hunk status node
+ self.hunks[nextfileno-1].append(hunkinfo.copy())
+ self.hunks[nextfileno-1][nexthunkno-1]["invalid"] = True
+ # switch to hunkskip state
+ hunkbody = False
+ hunkskip = True
+
+ # check exit conditions
+ if hunkactual["linessrc"] > hunkinfo.linessrc or hunkactual["linestgt"] > hunkinfo.linestgt:
+ warning("extra hunk no.%d lines at %d for target %s" % (nexthunkno, lineno+1, self.target[nextfileno-1]))
+ # add hunk status node
+ self.hunks[nextfileno-1].append(hunkinfo.copy())
+ self.hunks[nextfileno-1][nexthunkno-1]["invalid"] = True
+ # switch to hunkskip state
+ hunkbody = False
+ hunkskip = True
+ elif hunkinfo.linessrc == hunkactual["linessrc"] and hunkinfo.linestgt == hunkactual["linestgt"]:
+ self.hunks[nextfileno-1].append(hunkinfo.copy())
+ # switch to hunkskip state
+ hunkbody = False
+ hunkskip = True
+
+ # detect mixed window/unix line ends
+ ends = self.hunkends[nextfileno-1]
+ if ((ends["cr"]!=0) + (ends["crlf"]!=0) + (ends["lf"]!=0)) > 1:
+ warning("inconsistent line ends in patch hunks for %s" % self.source[nextfileno-1])
+ if debugmode:
+ debuglines = dict(ends)
+ debuglines.update(file=self.target[nextfileno-1], hunk=nexthunkno)
+ debug("crlf: %(crlf)d lf: %(lf)d cr: %(cr)d\t - file: %(file)s hunk: %(hunk)d" % debuglines)
+
+ if hunkskip:
+ match = re.match("^@@ -(\d+)(,(\d+))? \+(\d+)(,(\d+))?", line)
+ if match:
+ # switch to hunkhead state
+ hunkskip = False
+ hunkhead = True
+ elif line.startswith("--- "):
+ # switch to filenames state
+ hunkskip = False
+ filenames = True
+ if debugmode and len(self.source) > 0:
+ debug("- %2d hunks for %s" % (len(self.hunks[nextfileno-1]), self.source[nextfileno-1]))
+
+ if filenames:
+ if line.startswith("--- "):
+ if nextfileno in self.source:
+ warning("skipping invalid patch for %s" % self.source[nextfileno])
+ del self.source[nextfileno]
+ # double source filename line is encountered
+ # attempt to restart from this second line
+ re_filename = "^--- ([^\t]+)"
+ match = re.match(re_filename, line)
+ # todo: support spaces in filenames
+ if match:
+ self.source.append(match.group(1).strip())
+ else:
+ warning("skipping invalid filename at line %d" % lineno)
+ # switch back to headscan state
+ filenames = False
+ headscan = True
+ elif not line.startswith("+++ "):
+ if nextfileno in self.source:
+ warning("skipping invalid patch with no target for %s" % self.source[nextfileno])
+ del self.source[nextfileno]
+ else:
+ # this should be unreachable
+ warning("skipping invalid target patch")
+ filenames = False
+ headscan = True
+ else:
+ if nextfileno in self.target:
+ warning("skipping invalid patch - double target at line %d" % lineno)
+ del self.source[nextfileno]
+ del self.target[nextfileno]
+ nextfileno -= 1
+ # double target filename line is encountered
+ # switch back to headscan state
+ filenames = False
+ headscan = True
+ else:
+ re_filename = "^\+\+\+ ([^\t]+)"
+ match = re.match(re_filename, line)
+ if not match:
+ warning("skipping invalid patch - no target filename at line %d" % lineno)
+ # switch back to headscan state
+ filenames = False
+ headscan = True
+ else:
+ self.target.append(match.group(1).strip())
+ nextfileno += 1
+ # switch to hunkhead state
+ filenames = False
+ hunkhead = True
+ nexthunkno = 0
+ self.hunks.append([])
+ self.hunkends.append(lineends.copy())
+ continue
+
+ if hunkhead:
+ match = re.match("^@@ -(\d+)(,(\d+))? \+(\d+)(,(\d+))?", line)
+ if not match:
+ if nextfileno-1 not in self.hunks:
+ warning("skipping invalid patch with no hunks for file %s" % self.target[nextfileno-1])
+ # switch to headscan state
+ hunkhead = False
+ headscan = True
+ continue
+ else:
+ # switch to headscan state
+ hunkhead = False
+ headscan = True
+ else:
+ hunkinfo.startsrc = int(match.group(1))
+ hunkinfo.linessrc = 1
+ if match.group(3): hunkinfo.linessrc = int(match.group(3))
+ hunkinfo.starttgt = int(match.group(4))
+ hunkinfo.linestgt = 1
+ if match.group(6): hunkinfo.linestgt = int(match.group(6))
+ hunkinfo.invalid = False
+ hunkinfo.text = []
+
+ hunkactual["linessrc"] = hunkactual["linestgt"] = 0
+
+ # switch to hunkbody state
+ hunkhead = False
+ hunkbody = True
+ nexthunkno += 1
+ continue
+
+ if not hunkskip:
+ warning("patch file incomplete - %s" % filename)
+ # sys.exit(?)
+ else:
+ # duplicated message when an eof is reached
+ if debugmode and len(self.source) > 0:
+ debug("- %2d hunks for %s" % (len(self.hunks[nextfileno-1]), self.source[nextfileno-1]))
+
+ info("total files: %d total hunks: %d" % (len(self.source), sum([len(hset) for hset in self.hunks])))
+
+
+ def apply(self):
+ """ apply parsed patch """
+
+ total = len(self.source)
+ for fileno, filename in enumerate(self.source):
+
+ f2patch = filename
+ if not exists(f2patch):
+ f2patch = self.target[fileno]
+ if not exists(f2patch):
+ warning("source/target file does not exist\n--- %s\n+++ %s" % (filename, f2patch))
+ continue
+ if not isfile(f2patch):
+ warning("not a file - %s" % f2patch)
+ continue
+ filename = f2patch
+
+ info("processing %d/%d:\t %s" % (fileno+1, total, filename))
+
+ # validate before patching
+ f2fp = open(filename)
+ hunkno = 0
+ hunk = self.hunks[fileno][hunkno]
+ hunkfind = []
+ hunkreplace = []
+ validhunks = 0
+ canpatch = False
+ for lineno, line in enumerate(f2fp):
+ if lineno+1 < hunk.startsrc:
+ continue
+ elif lineno+1 == hunk.startsrc:
+ hunkfind = [x[1:].rstrip("\r\n") for x in hunk.text if x[0] in " -"]
+ hunkreplace = [x[1:].rstrip("\r\n") for x in hunk.text if x[0] in " +"]
+ #pprint(hunkreplace)
+ hunklineno = 0
+
+ # todo \ No newline at end of file
+
+ # check hunks in source file
+ if lineno+1 < hunk.startsrc+len(hunkfind)-1:
+ if line.rstrip("\r\n") == hunkfind[hunklineno]:
+ hunklineno+=1
+ else:
+ debug("hunk no.%d doesn't match source file %s" % (hunkno+1, filename))
+ # file may be already patched, but we will check other hunks anyway
+ hunkno += 1
+ if hunkno < len(self.hunks[fileno]):
+ hunk = self.hunks[fileno][hunkno]
+ continue
+ else:
+ break
+
+ # check if processed line is the last line
+ if lineno+1 == hunk.startsrc+len(hunkfind)-1:
+ debug("file %s hunk no.%d -- is ready to be patched" % (filename, hunkno+1))
+ hunkno+=1
+ validhunks+=1
+ if hunkno < len(self.hunks[fileno]):
+ hunk = self.hunks[fileno][hunkno]
+ else:
+ if validhunks == len(self.hunks[fileno]):
+ # patch file
+ canpatch = True
+ break
+ else:
+ if hunkno < len(self.hunks[fileno]):
+ warning("premature end of source file %s at hunk %d" % (filename, hunkno+1))
+
+ f2fp.close()
+
+ if validhunks < len(self.hunks[fileno]):
+ if self._match_file_hunks(filename, self.hunks[fileno]):
+ warning("already patched %s" % filename)
+ else:
+ warning("source file is different - %s" % filename)
+ if canpatch:
+ backupname = filename+".orig"
+ if exists(backupname):
+ warning("can't backup original file to %s - aborting" % backupname)
+ else:
+ import shutil
+ shutil.move(filename, backupname)
+ if self.write_hunks(backupname, filename, self.hunks[fileno]):
+ info("successfully patched %s" % filename)
+ unlink(backupname)
+ else:
+ warning("error patching file %s" % filename)
+ shutil.copy(filename, filename+".invalid")
+ warning("invalid version is saved to %s" % filename+".invalid")
+ # todo: proper rejects
+ shutil.move(backupname, filename)
+
+ # todo: check for premature eof
+
+
+ def can_patch(self, filename):
+ """ Check if specified filename can be patched. Returns None if file can
+ not be found among source filenames. False if patch can not be applied
+ clearly. True otherwise.
+
+ :returns: True, False or None
+ """
+ idx = self._get_file_idx(filename, source=True)
+ if idx == None:
+ return None
+ return self._match_file_hunks(filename, self.hunks[idx])
+
+
+ def _match_file_hunks(self, filepath, hunks):
+ matched = True
+ fp = open(abspath(filepath))
+
+ class NoMatch(Exception):
+ pass
+
+ lineno = 1
+ line = fp.readline()
+ hno = None
+ try:
+ for hno, h in enumerate(hunks):
+ # skip to first line of the hunk
+ while lineno < h.starttgt:
+ if not len(line): # eof
+ debug("check failed - premature eof before hunk: %d" % (hno+1))
+ raise NoMatch
+ line = fp.readline()
+ lineno += 1
+ for hline in h.text:
+ if hline.startswith("-"):
+ continue
+ if not len(line):
+ debug("check failed - premature eof on hunk: %d" % (hno+1))
+ # todo: \ No newline at the end of file
+ raise NoMatch
+ if line.rstrip("\r\n") != hline[1:].rstrip("\r\n"):
+ debug("file is not patched - failed hunk: %d" % (hno+1))
+ raise NoMatch
+ line = fp.readline()
+ lineno += 1
+
+ except NoMatch:
+ matched = False
+ # todo: display failed hunk, i.e. expected/found
+
+ fp.close()
+ return matched
+
+
+ def patch_stream(self, instream, hunks):
+ """ Generator that yields stream patched with hunks iterable
+
+ Converts lineends in hunk lines to the best suitable format
+ autodetected from input
+ """
+
+ # todo: At the moment substituted lineends may not be the same
+ # at the start and at the end of patching. Also issue a
+ # warning/throw about mixed lineends (is it really needed?)
+
+ hunks = iter(hunks)
+
+ srclineno = 1
+
+ lineends = {'\n':0, '\r\n':0, '\r':0}
+ def get_line():
+ """
+ local utility function - return line from source stream
+ collecting line end statistics on the way
+ """
+ line = instream.readline()
+ # 'U' mode works only with text files
+ if line.endswith("\r\n"):
+ lineends["\r\n"] += 1
+ elif line.endswith("\n"):
+ lineends["\n"] += 1
+ elif line.endswith("\r"):
+ lineends["\r"] += 1
+ return line
+
+ for hno, h in enumerate(hunks):
+ debug("hunk %d" % (hno+1))
+ # skip to line just before hunk starts
+ while srclineno < h.startsrc:
+ yield get_line()
+ srclineno += 1
+
+ for hline in h.text:
+ # todo: check \ No newline at the end of file
+ if hline.startswith("-") or hline.startswith("\\"):
+ get_line()
+ srclineno += 1
+ continue
+ else:
+ if not hline.startswith("+"):
+ get_line()
+ srclineno += 1
+ line2write = hline[1:]
+ # detect if line ends are consistent in source file
+ if sum([bool(lineends[x]) for x in lineends]) == 1:
+ newline = [x for x in lineends if lineends[x] != 0][0]
+ yield line2write.rstrip("\r\n")+newline
+ else: # newlines are mixed
+ yield line2write
+
+ for line in instream:
+ yield line
+
+
+ def write_hunks(self, srcname, tgtname, hunks):
+ src = open(srcname, "r")
+ tgt = open(tgtname, "w")
+
+ debug("processing target file %s" % tgtname)
+
+ tgt.writelines(self.patch_stream(src, hunks))
+
+ tgt.close()
+ src.close()
+ return True
+
+
+ def _get_file_idx(self, filename, source=None):
+ """ Detect index of given filename within patch.
+
+ :param filename:
+ :param source: search filename among sources (True),
+ targets (False), or both (None)
+ :returns: int or None
+ """
+ filename = abspath(filename)
+ if source == True or source == None:
+ for i,fnm in enumerate(self.source):
+ if filename == abspath(fnm):
+ return i
+ if source == False or source == None:
+ for i,fnm in enumerate(self.target):
+ if filename == abspath(fnm):
+ return i
+
+
+
+
+if __name__ == "__main__":
+ from optparse import OptionParser
+ from os.path import exists
+ import sys
+
+ opt = OptionParser(usage="%prog [options] unipatch-file", version="python-patch %s" % __version__)
+ opt.add_option("-d", "--debug", action="store_true", dest="debugmode", help="Print debugging messages")
+ opt.add_option("-q", "--quiet", action="store_true", dest="quiet", help="Only print messages on warning/error")
+ (options, args) = opt.parse_args()
+
+ if not args:
+ opt.print_version()
+ opt.print_help()
+ sys.exit()
+ debugmode = options.debugmode
+ patchfile = args[0]
+ if not exists(patchfile) or not isfile(patchfile):
+ sys.exit("patch file does not exist - %s" % patchfile)
+
+
+ if debugmode:
+ loglevel = logging.DEBUG
+ logformat = "%(levelname)8s %(message)s"
+ elif options.quiet:
+ loglevel = logging.WARN
+ logformat = "%(message)s"
+ else:
+ loglevel = logging.INFO
+ logformat = "%(message)s"
+ logger.setLevel(loglevel)
+ loghandler.setFormatter(logging.Formatter(logformat))
+
+
+
+ patch = fromfile(patchfile)
+ #pprint(patch)
+ patch.apply()
+
+ # todo: document and test line ends handling logic - patch.py detects proper line-endings
+ # for inserted hunks and issues a warning if patched file has incosistent line ends
diff --git a/setup3lib.py b/setup3lib.py
new file mode 100644
index 0000000..55cdc66
--- /dev/null
+++ b/setup3lib.py
@@ -0,0 +1,151 @@
+import sys
+from setuptools import setup as _setup
+
+py3_args = ['use_2to3', 'convert_2to3_doctests', 'use_2to3_fixers', 'test_dirs', 'test_build_dir', 'doctest_exts', 'pyversion_patching']
+
+if sys.version_info < (3,):
+ # Remove any Python-3.x-only arguments (so they don't generate complaints
+ # from 2.x setuptools) and then just pass through to the regular setup
+ # routine.
+ def setup(*args, **kwargs):
+ for a in py3_args:
+ if a in kwargs:
+ del kwargs[a]
+ return _setup(*args, **kwargs)
+else:
+ import glob
+ import os
+ import re
+ import logging
+ from setuptools import Distribution as _Distribution
+ from distutils.core import Command
+ from setuptools.command.build_py import Mixin2to3
+ from distutils import dir_util, file_util, log
+ import setuptools.command.test
+ from pkg_resources import normalize_path, Environment
+ try:
+ import patch
+ patch.logger.setLevel(logging.WARN)
+ except ImportError:
+ patch = None
+
+ patchfile_re = re.compile(r'(.*)\.py([0-9.]+)\.patch$')
+
+ def pyversion_patch(filename):
+ '''Find the best pyversion-fixup patch for a given filename and apply
+ it.
+ '''
+ dir, file = os.path.split(filename)
+ best_ver = (0,)
+ patchfile = None
+ for dirfile in os.listdir(dir):
+ m = patchfile_re.match(dirfile)
+ if not m:
+ continue
+ base, ver = m.groups()
+ if base != file:
+ continue
+ ver = tuple([int(v) for v in ver.split('.')])
+ if sys.version_info >= ver and ver > best_ver:
+ best_ver = ver
+ patchfile = dirfile
+ if not patchfile:
+ return False
+ log.info("Applying %s to %s..." % (patchfile, filename))
+ cwd = os.getcwd()
+ os.chdir(dir)
+ try:
+ p = patch.fromfile(patchfile)
+ p.apply()
+ finally:
+ os.chdir(cwd)
+ return True
+
+ class Distribution (_Distribution):
+ def __init__(self, attrs=None):
+ self.test_dirs = []
+ self.test_build_dir = None
+ self.doctest_exts = ['.py', '.rst']
+ self.pyversion_patching = False
+ _Distribution.__init__(self, attrs)
+
+ class BuildTestsCommand (Command, Mixin2to3):
+ # Create mirror copy of tests, convert all .py files using 2to3
+ user_options = []
+
+ def initialize_options(self):
+ self.test_base = None
+
+ def finalize_options(self):
+ test_base = self.distribution.test_build_dir
+ if not test_base:
+ bcmd = self.get_finalized_command('build')
+ test_base = bcmd.build_base
+ self.test_base = test_base
+
+ def run(self):
+ use_2to3 = getattr(self.distribution, 'use_2to3', False)
+ test_dirs = getattr(self.distribution, 'test_dirs', [])
+ test_base = self.test_base
+ bpy_cmd = self.get_finalized_command("build_py")
+ lib_base = normalize_path(bpy_cmd.build_lib)
+ modified = []
+ py_modified = []
+ doc_modified = []
+ dir_util.mkpath(test_base)
+ for testdir in test_dirs:
+ for srcdir, dirnames, filenames in os.walk(testdir):
+ destdir = os.path.join(test_base, srcdir)
+ dir_util.mkpath(destdir)
+ for fn in filenames:
+ if fn.startswith("."):
+ # Skip .svn folders and such
+ continue
+ dstfile, copied = file_util.copy_file(
+ os.path.join(srcdir, fn),
+ os.path.join(destdir, fn),
+ update=True)
+ if copied:
+ modified.append(dstfile)
+ if fn.endswith('.py'):
+ py_modified.append(dstfile)
+ for ext in self.distribution.doctest_exts:
+ if fn.endswith(ext):
+ doc_modified.append(dstfile)
+ break
+ if use_2to3:
+ self.run_2to3(py_modified)
+ self.run_2to3(doc_modified, True)
+ if self.distribution.pyversion_patching:
+ if patch is not None:
+ for file in modified:
+ pyversion_patch(file)
+ else:
+ log.warn("Warning: pyversion_patching specified in setup config but patch module not found. Patching will not be performed.")
+
+ dir_util.mkpath(lib_base)
+ self.reinitialize_command('egg_info', egg_base=lib_base)
+ self.run_command('egg_info')
+
+ class TestCommand (setuptools.command.test.test):
+ # Override 'test' command to make sure 'build_tests' gets run first.
+ def run(self):
+ self.run_command('build_tests')
+ this_dir = os.path.normpath(os.path.abspath(os.path.dirname(__file__)))
+ lib_dirs = glob.glob(os.path.join(this_dir, 'build', 'lib*'))
+ test_dir = os.path.join(this_dir, 'build', 'tests')
+ env = Environment(search_path=lib_dirs)
+ distributions = env["nose"]
+ assert len(distributions) == 1, (
+ "Incorrect number of distributions found")
+ dist = distributions[0]
+ dist.activate()
+ sys.path.insert(0, test_dir)
+ setuptools.command.test.test.run(self)
+
+ def setup(*args, **kwargs):
+ kwargs.setdefault('distclass', Distribution)
+ cmdclass = kwargs.setdefault('cmdclass', {})
+ cmdclass.setdefault('build_tests', BuildTestsCommand)
+ cmdclass.setdefault('test', TestCommand)
+ return _setup(*args, **kwargs)
diff --git a/unit_tests/helpers.pyc b/unit_tests/helpers.pyc
new file mode 100644
index 0000000..003577b
--- /dev/null
+++ b/unit_tests/helpers.pyc
Binary files differ
diff --git a/unit_tests/mock.pyc b/unit_tests/mock.pyc
new file mode 100644
index 0000000..b6436a4
--- /dev/null
+++ b/unit_tests/mock.pyc
Binary files differ
diff --git a/unit_tests/support/bug105/tests.pyc b/unit_tests/support/bug105/tests.pyc
new file mode 100644
index 0000000..143f3ae
--- /dev/null
+++ b/unit_tests/support/bug105/tests.pyc
Binary files differ
diff --git a/unit_tests/support/doctest/err_doctests.pyc b/unit_tests/support/doctest/err_doctests.pyc
new file mode 100644
index 0000000..22232ee
--- /dev/null
+++ b/unit_tests/support/doctest/err_doctests.pyc
Binary files differ
diff --git a/unit_tests/support/doctest/no_doctests.pyc b/unit_tests/support/doctest/no_doctests.pyc
new file mode 100644
index 0000000..a39cf86
--- /dev/null
+++ b/unit_tests/support/doctest/no_doctests.pyc
Binary files differ
diff --git a/unit_tests/support/foo/__init__.pyc b/unit_tests/support/foo/__init__.pyc
new file mode 100644
index 0000000..14c51cb
--- /dev/null
+++ b/unit_tests/support/foo/__init__.pyc
Binary files differ
diff --git a/unit_tests/support/foo/bar/__init__.pyc b/unit_tests/support/foo/bar/__init__.pyc
new file mode 100644
index 0000000..6b51be8
--- /dev/null
+++ b/unit_tests/support/foo/bar/__init__.pyc
Binary files differ
diff --git a/unit_tests/support/foo/bar/buz.pyc b/unit_tests/support/foo/bar/buz.pyc
new file mode 100644
index 0000000..eb3cced
--- /dev/null
+++ b/unit_tests/support/foo/bar/buz.pyc
Binary files differ
diff --git a/unit_tests/support/issue006/tests.pyc b/unit_tests/support/issue006/tests.pyc
new file mode 100644
index 0000000..ee9237e
--- /dev/null
+++ b/unit_tests/support/issue006/tests.pyc
Binary files differ
diff --git a/unit_tests/support/issue065/tests.pyc b/unit_tests/support/issue065/tests.pyc
new file mode 100644
index 0000000..eaa6058
--- /dev/null
+++ b/unit_tests/support/issue065/tests.pyc
Binary files differ
diff --git a/unit_tests/support/issue270/__init__.pyc b/unit_tests/support/issue270/__init__.pyc
new file mode 100644
index 0000000..ff4662f
--- /dev/null
+++ b/unit_tests/support/issue270/__init__.pyc
Binary files differ
diff --git a/unit_tests/support/issue270/foo_test.pyc b/unit_tests/support/issue270/foo_test.pyc
new file mode 100644
index 0000000..515392d
--- /dev/null
+++ b/unit_tests/support/issue270/foo_test.pyc
Binary files differ
diff --git a/unit_tests/test_attribute_plugin.pyc b/unit_tests/test_attribute_plugin.pyc
new file mode 100644
index 0000000..4c69c61
--- /dev/null
+++ b/unit_tests/test_attribute_plugin.pyc
Binary files differ
diff --git a/unit_tests/test_bug105.pyc b/unit_tests/test_bug105.pyc
new file mode 100644
index 0000000..e151841
--- /dev/null
+++ b/unit_tests/test_bug105.pyc
Binary files differ
diff --git a/unit_tests/test_capture_plugin.pyc b/unit_tests/test_capture_plugin.pyc
new file mode 100644
index 0000000..8adbe7c
--- /dev/null
+++ b/unit_tests/test_capture_plugin.pyc
Binary files differ
diff --git a/unit_tests/test_cases.pyc b/unit_tests/test_cases.pyc
new file mode 100644
index 0000000..12fbf8c
--- /dev/null
+++ b/unit_tests/test_cases.pyc
Binary files differ
diff --git a/unit_tests/test_config.pyc b/unit_tests/test_config.pyc
new file mode 100644
index 0000000..f0d52fd
--- /dev/null
+++ b/unit_tests/test_config.pyc
Binary files differ
diff --git a/unit_tests/test_core.pyc b/unit_tests/test_core.pyc
new file mode 100644
index 0000000..468fb32
--- /dev/null
+++ b/unit_tests/test_core.pyc
Binary files differ
diff --git a/unit_tests/test_deprecated_plugin.pyc b/unit_tests/test_deprecated_plugin.pyc
new file mode 100644
index 0000000..04c5e44
--- /dev/null
+++ b/unit_tests/test_deprecated_plugin.pyc
Binary files differ
diff --git a/unit_tests/test_doctest_error_handling.pyc b/unit_tests/test_doctest_error_handling.pyc
new file mode 100644
index 0000000..3614931
--- /dev/null
+++ b/unit_tests/test_doctest_error_handling.pyc
Binary files differ
diff --git a/unit_tests/test_id_plugin.pyc b/unit_tests/test_id_plugin.pyc
new file mode 100644
index 0000000..3f46a4c
--- /dev/null
+++ b/unit_tests/test_id_plugin.pyc
Binary files differ
diff --git a/unit_tests/test_importer.pyc b/unit_tests/test_importer.pyc
new file mode 100644
index 0000000..6f218cb
--- /dev/null
+++ b/unit_tests/test_importer.pyc
Binary files differ
diff --git a/unit_tests/test_inspector.pyc b/unit_tests/test_inspector.pyc
new file mode 100644
index 0000000..67417d0
--- /dev/null
+++ b/unit_tests/test_inspector.pyc
Binary files differ
diff --git a/unit_tests/test_isolation_plugin.pyc b/unit_tests/test_isolation_plugin.pyc
new file mode 100644
index 0000000..f1ec934
--- /dev/null
+++ b/unit_tests/test_isolation_plugin.pyc
Binary files differ
diff --git a/unit_tests/test_issue270_fixtures.pyc b/unit_tests/test_issue270_fixtures.pyc
new file mode 100644
index 0000000..48cd094
--- /dev/null
+++ b/unit_tests/test_issue270_fixtures.pyc
Binary files differ
diff --git a/unit_tests/test_issue_006.pyc b/unit_tests/test_issue_006.pyc
new file mode 100644
index 0000000..7618620
--- /dev/null
+++ b/unit_tests/test_issue_006.pyc
Binary files differ
diff --git a/unit_tests/test_issue_064.pyc b/unit_tests/test_issue_064.pyc
new file mode 100644
index 0000000..dbc08e5
--- /dev/null
+++ b/unit_tests/test_issue_064.pyc
Binary files differ
diff --git a/unit_tests/test_issue_065.pyc b/unit_tests/test_issue_065.pyc
new file mode 100644
index 0000000..2c02d73
--- /dev/null
+++ b/unit_tests/test_issue_065.pyc
Binary files differ
diff --git a/unit_tests/test_issue_100.rst.py3.patch b/unit_tests/test_issue_100.rst.py3.patch
new file mode 100644
index 0000000..58ba2a3
--- /dev/null
+++ b/unit_tests/test_issue_100.rst.py3.patch
@@ -0,0 +1,8 @@
+--- test_issue_100.rst.orig 2010-08-30 19:31:28.000000000 -0700
++++ test_issue_100.rst 2010-08-30 19:31:41.000000000 -0700
+@@ -9,4 +9,4 @@
+ ... pass
+ >>> test = nose.case.Test(SimpleTest())
+ >>> test.address()
+- (None, '__builtin__', 'SimpleTest.runTest')
++ (None, 'builtins', 'SimpleTest.runTest')
diff --git a/unit_tests/test_issue_101.pyc b/unit_tests/test_issue_101.pyc
new file mode 100644
index 0000000..09ae6e4
--- /dev/null
+++ b/unit_tests/test_issue_101.pyc
Binary files differ
diff --git a/unit_tests/test_issue_227.pyc b/unit_tests/test_issue_227.pyc
new file mode 100644
index 0000000..ead4f3e
--- /dev/null
+++ b/unit_tests/test_issue_227.pyc
Binary files differ
diff --git a/unit_tests/test_issue_230.pyc b/unit_tests/test_issue_230.pyc
new file mode 100644
index 0000000..2d5f7d1
--- /dev/null
+++ b/unit_tests/test_issue_230.pyc
Binary files differ
diff --git a/unit_tests/test_lazy_suite.pyc b/unit_tests/test_lazy_suite.pyc
new file mode 100644
index 0000000..227b39f
--- /dev/null
+++ b/unit_tests/test_lazy_suite.pyc
Binary files differ
diff --git a/unit_tests/test_loader.pyc b/unit_tests/test_loader.pyc
new file mode 100644
index 0000000..2c21bf5
--- /dev/null
+++ b/unit_tests/test_loader.pyc
Binary files differ
diff --git a/unit_tests/test_logcapture_plugin.pyc b/unit_tests/test_logcapture_plugin.pyc
new file mode 100644
index 0000000..da92f86
--- /dev/null
+++ b/unit_tests/test_logcapture_plugin.pyc
Binary files differ
diff --git a/unit_tests/test_logging.pyc b/unit_tests/test_logging.pyc
new file mode 100644
index 0000000..3f64bf3
--- /dev/null
+++ b/unit_tests/test_logging.pyc
Binary files differ
diff --git a/unit_tests/test_multiprocess.pyc b/unit_tests/test_multiprocess.pyc
new file mode 100644
index 0000000..9776f82
--- /dev/null
+++ b/unit_tests/test_multiprocess.pyc
Binary files differ
diff --git a/unit_tests/test_multiprocess_runner.pyc b/unit_tests/test_multiprocess_runner.pyc
new file mode 100644
index 0000000..3705f31
--- /dev/null
+++ b/unit_tests/test_multiprocess_runner.pyc
Binary files differ
diff --git a/unit_tests/test_pdb_plugin.pyc b/unit_tests/test_pdb_plugin.pyc
new file mode 100644
index 0000000..9d5ae1c
--- /dev/null
+++ b/unit_tests/test_pdb_plugin.pyc
Binary files differ
diff --git a/unit_tests/test_plugin.pyc b/unit_tests/test_plugin.pyc
new file mode 100644
index 0000000..1d5f9d0
--- /dev/null
+++ b/unit_tests/test_plugin.pyc
Binary files differ
diff --git a/unit_tests/test_plugin_interfaces.pyc b/unit_tests/test_plugin_interfaces.pyc
new file mode 100644
index 0000000..ba3bbe9
--- /dev/null
+++ b/unit_tests/test_plugin_interfaces.pyc
Binary files differ
diff --git a/unit_tests/test_plugin_manager.pyc b/unit_tests/test_plugin_manager.pyc
new file mode 100644
index 0000000..aa23287
--- /dev/null
+++ b/unit_tests/test_plugin_manager.pyc
Binary files differ
diff --git a/unit_tests/test_plugins.pyc b/unit_tests/test_plugins.pyc
new file mode 100644
index 0000000..dd87208
--- /dev/null
+++ b/unit_tests/test_plugins.pyc
Binary files differ
diff --git a/unit_tests/test_result_proxy.pyc b/unit_tests/test_result_proxy.pyc
new file mode 100644
index 0000000..027d6fc
--- /dev/null
+++ b/unit_tests/test_result_proxy.pyc
Binary files differ
diff --git a/unit_tests/test_selector.pyc b/unit_tests/test_selector.pyc
new file mode 100644
index 0000000..a3ae163
--- /dev/null
+++ b/unit_tests/test_selector.pyc
Binary files differ
diff --git a/unit_tests/test_selector_plugins.pyc b/unit_tests/test_selector_plugins.pyc
new file mode 100644
index 0000000..8f2101c
--- /dev/null
+++ b/unit_tests/test_selector_plugins.pyc
Binary files differ
diff --git a/unit_tests/test_skip_plugin.pyc b/unit_tests/test_skip_plugin.pyc
new file mode 100644
index 0000000..889b1a1
--- /dev/null
+++ b/unit_tests/test_skip_plugin.pyc
Binary files differ
diff --git a/unit_tests/test_suite.pyc b/unit_tests/test_suite.pyc
new file mode 100644
index 0000000..fcffeb7
--- /dev/null
+++ b/unit_tests/test_suite.pyc
Binary files differ
diff --git a/unit_tests/test_tools.pyc b/unit_tests/test_tools.pyc
new file mode 100644
index 0000000..59b4396
--- /dev/null
+++ b/unit_tests/test_tools.pyc
Binary files differ
diff --git a/unit_tests/test_twisted.pyc b/unit_tests/test_twisted.pyc
new file mode 100644
index 0000000..88786ea
--- /dev/null
+++ b/unit_tests/test_twisted.pyc
Binary files differ
diff --git a/unit_tests/test_twisted_testcase.pyc b/unit_tests/test_twisted_testcase.pyc
new file mode 100644
index 0000000..df9771a
--- /dev/null
+++ b/unit_tests/test_twisted_testcase.pyc
Binary files differ
diff --git a/unit_tests/test_utils.pyc b/unit_tests/test_utils.pyc
new file mode 100644
index 0000000..334c5cf
--- /dev/null
+++ b/unit_tests/test_utils.pyc
Binary files differ
diff --git a/unit_tests/test_xunit.pyc b/unit_tests/test_xunit.pyc
new file mode 100644
index 0000000..999a3fc
--- /dev/null
+++ b/unit_tests/test_xunit.pyc
Binary files differ