/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_setup.py

(mbp) Fix skip criteria for bzrlib.tests.test_setup (Max Bowsher)

Show diffs side-by-side

added added

removed removed

Lines of Context:
43
43
        This tests that the build process and man generator run correctly.
44
44
        It also can catch new subdirectories that weren't added to setup.py.
45
45
        """
46
 
        if not os.path.isfile('setup.py'):
47
 
            raise TestSkipped('There is no setup.py file in current directory')
 
46
        # setup.py must be run from the root source directory, but the tests
 
47
        # are not necessarily invoked from there
 
48
        self.source_dir = os.path.dirname(os.path.dirname(bzrlib.__file__))
 
49
        if not os.path.isfile(os.path.join(self.source_dir, 'setup.py')):
 
50
            raise TestSkipped('There is no setup.py file adjacent to the bzrlib directory')
48
51
        try:
49
52
            import distutils.sysconfig
50
53
            makefile_path = distutils.sysconfig.get_makefile_filename()
56
59
                              ' Usually this can be found by installing "python-dev"')
57
60
        self.log('test_build running in %s' % os.getcwd())
58
61
        install_dir = osutils.mkdtemp()
59
 
        # setup.py must be run from the root source directory, but the tests
60
 
        # are not necessarily invoked from there
61
 
        self.source_dir = os.path.dirname(os.path.dirname(bzrlib.__file__))
62
62
        try:
63
63
            self.run_setup(['clean'])
64
64
            # build is implied by install