7
from tempfile import TemporaryFile
8
9
from bzrlib.tests import TestCase
12
# TODO: ideally run this in a separate directory, so as not to clobber the
13
# real build directory
11
15
class TestSetup(TestCase):
16
17
def test_build(self):
17
""" test cmd `python setup.py build` """
18
# run setup.py build as subproces and catch return code
19
p = subprocess.Popen([sys.executable, 'setup.py', 'build'],
20
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
22
self.assertEqual(0, p.returncode, '`python setup.py build` fails')
25
""" cleanup build directory """
26
shutil.rmtree(u'build')
18
""" test cmd `python setup.py build`
20
This typically catches new subdirectories which weren't added to setup.py
22
self.log('test_build running in %s' % os.getcwd())
24
# run setup.py build as subproces and catch return code
25
out_file = TemporaryFile()
26
err_file = TemporaryFile()
27
p = subprocess.Popen([sys.executable, 'setup.py', 'build'],
28
stdout=out_file, stderr=err_file)
30
self.assertEqual(0, p.returncode, '`python setup.py build` fails')
32
if os.path.exists('build'):
33
shutil.rmtree(u'build')