diff options
-rw-r--r-- | src/test/py/bazel/test_base.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/test/py/bazel/test_base.py b/src/test/py/bazel/test_base.py index cabbeaf47e..fe228c9d15 100644 --- a/src/test/py/bazel/test_base.py +++ b/src/test/py/bazel/test_base.py @@ -94,10 +94,11 @@ class TestBase(unittest.TestCase): return os.name == 'nt' def Path(self, path): - """Returns the absolute path of `path` relative to the scratch directory. + """Returns the absolute path of `path` relative to self._test_cwd. Args: - path: string; a path, relative to the test's scratch directory, + path: string; a path, relative to self._test_cwd, + self._test_cwd is different for each test case. e.g. "foo/bar/BUILD" Returns: an absolute path @@ -107,7 +108,7 @@ class TestBase(unittest.TestCase): if os.path.isabs(path) or '..' in path: raise ArgumentError(('path="%s" may not be absolute and may not contain ' 'uplevel references') % path) - return os.path.join(self._tests_root, path) + return os.path.join(self._test_cwd, path) def Rlocation(self, runfile): """Returns the absolute path to a runfile.""" |