diff options
| author | Tarek Ziade <tarek@ziade.org> | 2010-04-07 10:00:46 +0200 |
|---|---|---|
| committer | Tarek Ziade <tarek@ziade.org> | 2010-04-07 10:00:46 +0200 |
| commit | cfdeb8b7836a5f50cdf3b4b85aede9513b53d7f0 (patch) | |
| tree | 7b67ad8d07a3c822c75c6a5eecf3fe920d46c727 /setuptools/tests/test_develop.py | |
| parent | 5308fca40b51b1c3eb3ce3f2b7d2cc9bc5eda6e6 (diff) | |
| download | python-setuptools-bitbucket-cfdeb8b7836a5f50cdf3b4b85aede9513b53d7f0.tar.gz | |
make sure we test that the directory exists before we install stuff asked by setup_requires fixes #138
Diffstat (limited to 'setuptools/tests/test_develop.py')
| -rw-r--r-- | setuptools/tests/test_develop.py | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/setuptools/tests/test_develop.py b/setuptools/tests/test_develop.py index 10b2be9e..a567dd5a 100644 --- a/setuptools/tests/test_develop.py +++ b/setuptools/tests/test_develop.py @@ -6,6 +6,7 @@ import tempfile import site from StringIO import StringIO +from distutils.errors import DistutilsError from setuptools.command.develop import develop from setuptools.command import easy_install as easy_install_pkg from setuptools.dist import Distribution @@ -18,7 +19,7 @@ setup(name='foo') class TestDevelopTest(unittest.TestCase): - def setUp(self): + def setUp(self): self.dir = tempfile.mkdtemp() setup = os.path.join(self.dir, 'setup.py') f = open(setup, 'w') @@ -32,7 +33,7 @@ class TestDevelopTest(unittest.TestCase): self.old_site = site.USER_SITE site.USER_SITE = tempfile.mkdtemp() - def tearDown(self): + def tearDown(self): os.chdir(self.old_cwd) shutil.rmtree(self.dir) if sys.version >= "2.6": @@ -63,3 +64,19 @@ class TestDevelopTest(unittest.TestCase): content.sort() self.assertEquals(content, ['UNKNOWN.egg-link', 'easy-install.pth']) + def test_develop_with_setup_requires(self): + + wanted = ("Could not find suitable distribution for " + "Requirement.parse('I-DONT-EXIST')") + old_dir = os.getcwd() + os.chdir(self.dir) + try: + try: + dist = Distribution({'setup_requires': ['I_DONT_EXIST']}) + except DistutilsError, e: + error = str(e) + if error == wanted: + pass + finally: + os.chdir(old_dir) + |
