4 from nose.plugins.skip import SkipTest
5 from nose import commands
6 from StringIO import StringIO
8 support = os.path.join(
9 os.path.dirname(__file__), 'support', 'issue191')
12 class TestCommands(unittest.TestCase):
17 raise SkipTest("setuptools not available")
18 self.dir = os.getcwd()
19 self.stderr = sys.stderr
24 sys.stderr = self.stderr
26 def test_setup_nosetests_command_works(self):
27 from setuptools.dist import Distribution
30 cmd = commands.nosetests(
31 Distribution(attrs={'script_name': 'setup.py',
32 'package_dir': {'issue191': support}}))
33 cmd.finalize_options()
34 ## FIXME why doesn't Config see the chdir above?
35 print cmd._nosetests__config.workingDir
36 cmd._nosetests__config.workingDir = support
37 cmd._nosetests__config.stream = buf
41 self.assertFalse(e.args[0], buf.getvalue())
43 self.fail("cmd.run() did not exit")
46 if __name__ == '__main__':