diff options
author | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2019-01-07 21:15:03 +0900 |
---|---|---|
committer | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2019-01-13 23:50:18 +0900 |
commit | d6fc5c90950d541a826a99a8bb88039a701f1a00 (patch) | |
tree | 7fbe96b1c32df81afde474b6f107160b72d00d02 /tests/conftest.py | |
parent | a4a206ce5a8146a431bff89553ada9e9634f3078 (diff) | |
download | sphinx-git-d6fc5c90950d541a826a99a8bb88039a701f1a00.tar.gz |
Stop to use $SPHINX_TEST_TEMPDIR envvar
At once, we added $SPHINX_TEST_TEMPDIR to keep intermediate files of
testing to investigate the failures. At present, we've used pytest
as a test runner. And it keeps temporary directories of last 3
testings. So this starts to use it instead of $SPHINX_TEST_TEMPDIR.
https://docs.pytest.org/en/latest/tmpdir.html#the-default-base-temporary-directory
Diffstat (limited to 'tests/conftest.py')
-rw-r--r-- | tests/conftest.py | 19 |
1 files changed, 0 insertions, 19 deletions
diff --git a/tests/conftest.py b/tests/conftest.py index 7d0c1570b..a8392a6c0 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -7,7 +7,6 @@ """ import os -import shutil import docutils import pytest @@ -32,23 +31,5 @@ def pytest_report_header(config): (sphinx.__display_version__, docutils.__version__)) -def _initialize_test_directory(session): - testroot = os.path.join(str(session.config.rootdir), 'tests') - tempdir = os.path.abspath(os.getenv('SPHINX_TEST_TEMPDIR', - os.path.join(testroot, 'build'))) - os.environ['SPHINX_TEST_TEMPDIR'] = tempdir - - print('Temporary files will be placed in %s.' % tempdir) - - if os.path.exists(tempdir): - shutil.rmtree(tempdir) - - os.makedirs(tempdir) - - -def pytest_sessionstart(session): - _initialize_test_directory(session) - - def pytest_assertrepr_compare(op, left, right): comparer.pytest_assertrepr_compare(op, left, right) |