blob: 8e398371bdd70326633dfc4dcfe42943337b61a6 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
diff --git a/os_api_ref/tests/base.py b/os_api_ref/tests/base.py
index 6e5e0dc..f5c2c1d 100644
--- a/os_api_ref/tests/base.py
+++ b/os_api_ref/tests/base.py
@@ -16,10 +16,11 @@
import os
import fixtures
+import shutil
import tempfile
import testtools
-from sphinx.testing.path import path
+from pathlib import Path
from sphinx.testing.util import SphinxTestApp
@@ -33,17 +34,16 @@ _TRUE_VALUES = ('True', 'true', '1', 'yes')
class with_app:
def __init__(self, **kwargs):
if 'srcdir' in kwargs:
- self.srcdir = path(kwargs['srcdir'])
+ self.srcdir = Path(kwargs['srcdir'])
self.sphinx_app_args = kwargs
def __call__(self, f):
def newf(*args, **kwargs):
with tempfile.TemporaryDirectory() as tmpdirname:
- tmpdir = path(tmpdirname)
- tmproot = tmpdir / self.srcdir.basename()
- self.srcdir.copytree(tmproot)
+ tmpdir = Path(tmpdirname)
+ tmproot = tmpdir / self.srcdir.name
+ shutil.copytree(self.srcdir, tmproot)
self.sphinx_app_args['srcdir'] = tmproot
- self.builddir = tmproot.joinpath('_build')
app = SphinxTestApp(freshenv=True, **self.sphinx_app_args)
|