提交 c36b600a 编写于 作者: C Cleber Rosa

Test: only publish *_BASEDIR and *_DATADIR env vars when they're set

IMHO it makes more sense to only publish these variables when they
actually contain meaningful value. Right now it *may* contain "None"
as this is maybe the value of the `basedir` and `datadir` attributes
when the test is not backed by a file.

Also, it's a lot more common, say, for a shell script to check if
a variable is set (if [ -n $AVOCADO_TEST_DATA_DIR ] ...) then to
check if it's not equal to "None".
Signed-off-by: NCleber Rosa <crosa@redhat.com>
上级 ee82c1b7
......@@ -465,8 +465,10 @@ class Test(unittest.TestCase):
def _setup_environment_variables(self):
os.environ['AVOCADO_VERSION'] = VERSION
os.environ['AVOCADO_TEST_BASEDIR'] = self.basedir
os.environ['AVOCADO_TEST_DATADIR'] = self.datadir
if self.basedir is not None:
os.environ['AVOCADO_TEST_BASEDIR'] = self.basedir
if self.datadir is not None:
os.environ['AVOCADO_TEST_DATADIR'] = self.datadir
os.environ['AVOCADO_TEST_WORKDIR'] = self.workdir
os.environ['AVOCADO_TEST_SRCDIR'] = self.srcdir
os.environ['AVOCADO_TEST_LOGDIR'] = self.logdir
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册