~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_setup.py

  • Committer: John Arbash Meinel
  • Date: 2005-12-16 04:53:00 UTC
  • mto: (1185.50.19 bzr-jam-integration)
  • mto: This revision was merged to the branch mainline in revision 1532.
  • Revision ID: john@arbash-meinel.com-20051216045300-316811378703a220
Switch to sys.executable instead of just 'python' to make sure to run the right executable

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 """