diff options
author | Lars Wirzenius <liw@liw.fi> | 2014-01-21 20:50:34 +0000 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2014-01-21 20:50:34 +0000 |
commit | 058d1ae7730d8306242035347cacd1ca7b9787d7 (patch) | |
tree | ec6a893ba75d896b4c57c82c842cceebb7c43ae6 /yarn | |
parent | 099c7d84298c12db09979903720fa44c615e1f7b (diff) | |
download | cmdtest-058d1ae7730d8306242035347cacd1ca7b9787d7.tar.gz |
Make yarn set $HOME to an existing directory
Diffstat (limited to 'yarn')
-rwxr-xr-x | yarn | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -289,6 +289,9 @@ class YarnRunner(cliapp.Application): datadir = self.datadir(tempdir, scenario) os.mkdir(datadir) self.info('DATADIR is %s' % datadir) + homedir = self.homedir(datadir) + os.mkdir(homedir) + self.info('HOME for tests is %s' % homedir) assuming = [s for s in scenario.steps if s.what == 'ASSUMING'] cleanup = [s for s in scenario.steps if s.what == 'FINALLY'] @@ -335,6 +338,9 @@ class YarnRunner(cliapp.Application): self.remember_scenario_timing(time.time() - started) return ok + def homedir(self, datadir): + return os.path.join(datadir, 'HOME') + def clean_env(self): '''Return a clean environment for running tests.''' @@ -349,7 +355,6 @@ class YarnRunner(cliapp.Application): 'USER': 'tomjon', 'USERNAME': 'tomjon', 'LOGNAME': 'tomjon', - 'HOME': '/this/path/does/not/exist', } env = {} @@ -384,6 +389,7 @@ class YarnRunner(cliapp.Application): env = self.clean_env() env['DATADIR'] = datadir env['SRCDIR'] = os.getcwd() + env['HOME'] = self.homedir(datadir) for i, match in enumerate(m.groups('')): env['MATCH_%d' % (i+1)] = match |