def pytest_configure(config): """ Here we ensure there's a recent bdist_egg available for all our integration tests """ if sys.argv == ['-c']: # This is most likely an xdist worker - we don't want these do do anything return pkg = [i for i in working_set if i.project_name == 'pkglib'][0] print "Building pkglib bdist_egg for tests" with chdir(pkg.location): subprocess.Popen([sys.executable, 'setup.py', 'bdist_egg']).communicate()
def test_Shell_func_1(): with chdir(os.path.dirname(__file__)): with Shell('ls') as s: assert os.path.basename(__file__) in s.out.split('\n')
def test_Shell_func_2(): this_dir = os.path.dirname(__file__) # start at parent of this directory with chdir(os.path.dirname(this_dir)): with Shell(['cd %s' % this_dir, 'ls']) as s: assert os.path.basename(__file__) in s.out.split('\n')