diff options
| author | aa-turner <aa-turner@929543f6-e4f2-0310-98a6-ba3bd3dd1d04> | 2022-11-10 16:25:32 +0000 |
|---|---|---|
| committer | aa-turner <aa-turner@929543f6-e4f2-0310-98a6-ba3bd3dd1d04> | 2022-11-10 16:25:32 +0000 |
| commit | 7688249672e39bac02e0c9b23101f78bf7de96ce (patch) | |
| tree | 3e9ea2ab6620fe557da39b91bce40293efab6ce7 /docutils/test/DocutilsTestSupport.py | |
| parent | 5517df0375eb0d32e45325c79007ab6c5a7cd156 (diff) | |
| download | docutils-7688249672e39bac02e0c9b23101f78bf7de96ce.tar.gz | |
Make the tests agnostic to the working directory
Previously, the test suite only worked when the current working
directory was ``docutils/test/`. With this change all relative paths
are calculated explicitly such that the working directory no longer
affects the tests, meaning a less fragile test environment and
greater flexibility to use test runners other than ``alltests.py``.
This is part of the test suite refactoring project.
git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9236 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
Diffstat (limited to 'docutils/test/DocutilsTestSupport.py')
| -rw-r--r-- | docutils/test/DocutilsTestSupport.py | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/docutils/test/DocutilsTestSupport.py b/docutils/test/DocutilsTestSupport.py index a8bb90fd0..db901469a 100644 --- a/docutils/test/DocutilsTestSupport.py +++ b/docutils/test/DocutilsTestSupport.py @@ -8,7 +8,6 @@ __docformat__ = 'reStructuredText' import os import sys -testroot = os.path.abspath(os.path.dirname(__file__) or os.curdir) -os.chdir(testroot) -sys.path.insert(0, os.path.normpath(os.path.join(testroot, '..'))) +testroot = os.path.abspath(os.path.dirname(__file__)) +sys.path.insert(0, os.path.dirname(testroot)) sys.path.insert(0, testroot) |
