[elbe-devel] [PATCH v2 5/6] tests doctests: Add filesystem doctests

Olivier Dion dion at linutronix.de
Mon May 25 20:25:55 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..9fd47d64 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.TmpdirFilesystem()
+    tests.addTests(doctest.DocTestSuite(filesystem, extraglobs={"this":fs}))
+
     return tests
-- 
2.26.2




More information about the elbe-devel mailing list