~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_setup.py

  • Committer: Robert Collins
  • Date: 2006-01-02 22:37:32 UTC
  • mfrom: (1185.50.33 bzr-jam-integration)
  • Revision ID: robertc@robertcollins.net-20060102223732-d5221b37ff0f7888
Merge in John Meinels integration branch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
""" test for setup.py build process """
2
2
 
3
3
import os
 
4
import sys
 
5
import subprocess
4
6
import shutil
5
7
 
6
8
from bzrlib.tests import TestCase
14
16
    def test_build(self):
15
17
        """ test cmd `python setup.py build` """
16
18
        # run setup.py build as subproces and catch return code
17
 
        p = os.popen("python setup.py build")
18
 
        s = p.readlines()
19
 
        res = p.close()
20
 
        self.assertEqual(res, None, '`python setup.py build` fails')
 
19
        p = subprocess.Popen([sys.executable, 'setup.py', 'build'],
 
20
                stdout=subprocess.PIPE, stderr=subprocess.PIPE)
 
21
        s = p.communicate()
 
22
        self.assertEqual(0, p.returncode, '`python setup.py build` fails')
21
23
 
22
24
    def tearDown(self):
23
25
        """ cleanup build directory """