[elbe-devel] [PATCH 4/5] tests doctests: Add filesystem doctests
Olivier Dion
dion at linutronix.de
Mon May 18 16:09:59 CEST 2020
The extraglobs will put the 'this' variable at our disposition for
testing a filesystem. The variable name 'this' was chosent as to not
make confusion with 'self'.
Signed-off-by: Olivier Dion <dion at linutronix.de>
---
elbepack/tests/test_doctest.py | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/elbepack/tests/test_doctest.py b/elbepack/tests/test_doctest.py
index 598c2d17..6963f231 100644
--- a/elbepack/tests/test_doctest.py
+++ b/elbepack/tests/test_doctest.py
@@ -7,7 +7,11 @@ import doctest
import unittest
import elbepack.shellhelper as shellhelper
+import elbepack.filesystem as filesystem
def load_tests(loader, tests, ignore):
tests.addTests(doctest.DocTestSuite(shellhelper))
+ fs = filesystem.Filesystem('/tmp/elbe-doctests', clean=True)
+ tests.addTests(doctest.DocTestSuite(filesystem, extraglobs={"this":fs}))
+
return tests
--
2.26.2
More information about the elbe-devel
mailing list