diff options
| author | milde <milde@929543f6-e4f2-0310-98a6-ba3bd3dd1d04> | 2022-11-25 14:01:57 +0000 |
|---|---|---|
| committer | milde <milde@929543f6-e4f2-0310-98a6-ba3bd3dd1d04> | 2022-11-25 14:01:57 +0000 |
| commit | ddf5175e10ca55e8baafd2d402918a9d7d51451d (patch) | |
| tree | f341068b88f70ac84ac8ed1ed89e78114f23b2d6 /docutils/test/test_functional.py | |
| parent | c6ade6048d93724358a80100196971f6583fa64d (diff) | |
| download | docutils-ddf5175e10ca55e8baafd2d402918a9d7d51451d.tar.gz | |
Fix import errors with ``python -m unittest``.
Running standard unittest on the test suite resulted in 89 ImportErrors
because ``import DocutilsTestSupport was used to set up sys.path()
but the module could not be found on the original sys.path().
git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9274 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
Diffstat (limited to 'docutils/test/test_functional.py')
| -rwxr-xr-x | docutils/test/test_functional.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/docutils/test/test_functional.py b/docutils/test/test_functional.py index 17a81bb50..d1a1d5f17 100755 --- a/docutils/test/test_functional.py +++ b/docutils/test/test_functional.py @@ -13,8 +13,14 @@ __ ../../docs/dev/testing.html#functional from pathlib import Path import shutil +import sys import unittest +if __name__ == '__main__': + # prepend the "docutils root" to the Python library path + # so we import the local `docutils` package. + sys.path.insert(0, str(Path(__file__).parents[1])) + from docutils import core, SettingsSpec FUNCTIONAL = Path('functional') |
