summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Pellerin <jpellerin@gmail.com>2008-06-02 23:22:06 +0000
committerJason Pellerin <jpellerin@gmail.com>2008-06-02 23:22:06 +0000
commit8ccc26b620be6dd4bb542351b448a30f4ab1a22b (patch)
treed8c1c097f475fe03b9b304d792bfd566cb843efc
parentee04f920a5cf6f50fde18725dc8d62a22ff1afbc (diff)
downloadnose-8ccc26b620be6dd4bb542351b448a30f4ab1a22b.tar.gz
Added regression tests for issue 191
-rw-r--r--functional_tests/support/issue191/setup.cfg2
-rw-r--r--functional_tests/support/issue191/setup.py3
-rw-r--r--functional_tests/support/issue191/test.py2
-rw-r--r--functional_tests/test_commands.py53
-rw-r--r--nose/commands.py3
5 files changed, 60 insertions, 3 deletions
diff --git a/functional_tests/support/issue191/setup.cfg b/functional_tests/support/issue191/setup.cfg
new file mode 100644
index 0000000..431cf7a
--- /dev/null
+++ b/functional_tests/support/issue191/setup.cfg
@@ -0,0 +1,2 @@
+[nosetests]
+verbosity=2 \ No newline at end of file
diff --git a/functional_tests/support/issue191/setup.py b/functional_tests/support/issue191/setup.py
new file mode 100644
index 0000000..86276be
--- /dev/null
+++ b/functional_tests/support/issue191/setup.py
@@ -0,0 +1,3 @@
+from setuptools import setup
+
+setup(name='issue191')
diff --git a/functional_tests/support/issue191/test.py b/functional_tests/support/issue191/test.py
new file mode 100644
index 0000000..f174823
--- /dev/null
+++ b/functional_tests/support/issue191/test.py
@@ -0,0 +1,2 @@
+def test():
+ pass
diff --git a/functional_tests/test_commands.py b/functional_tests/test_commands.py
new file mode 100644
index 0000000..1d7a032
--- /dev/null
+++ b/functional_tests/test_commands.py
@@ -0,0 +1,53 @@
+import os
+import subprocess
+import sys
+import unittest
+from nose.plugins.skip import SkipTest
+from nose import commands
+from StringIO import StringIO
+
+support = os.path.join(
+ os.path.dirname(__file__), 'support', 'issue191')
+
+
+class TestCommands(unittest.TestCase):
+ def setUp(self):
+ try:
+ import setuptools
+ except ImportError:
+ raise SkipTest("setuptools not available")
+ self.dir = os.getcwd()
+ self.stderr = sys.stderr
+ os.chdir(support)
+
+ def tearDown(self):
+ os.chdir(self.dir)
+ sys.stderr = self.stderr
+
+ def test_setup_nosetests_command_works(self):
+ from setuptools.dist import Distribution
+ buf = StringIO()
+ sys.stderr = buf
+ cmd = commands.nosetests(
+ Distribution(attrs={'script_name': 'setup.py',
+ 'package_dir': {'issue191': support}}))
+ cmd.finalize_options()
+ ## FIXME why doesn't Config see the chdir above?
+ print cmd._nosetests__config.workingDir
+ cmd._nosetests__config.workingDir = support
+ cmd._nosetests__config.stream = buf
+ try:
+ cmd.run()
+ except SystemExit, e:
+ self.assertFalse(e.args[0], buf.getvalue())
+ else:
+ self.fail("cmd.run() did not exit")
+
+# assert subprocess.call(
+# ["python", "setup.py", "nosetests", "2>/dev/null"],
+# shell=True) == 0, \
+# "python setup.py nosetests in %s failed" % support
+
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/nose/commands.py b/nose/commands.py
index 19f3bfd..8bafc5f 100644
--- a/nose/commands.py
+++ b/nose/commands.py
@@ -96,9 +96,6 @@ else:
def run(self):
"""ensure tests are capable of being run, then
run nose.main with a reconstructed argument list"""
- from nose.tools import set_trace
- set_trace()
-
self.run_command('egg_info')
# Build extensions in-place