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

Torben Hohn torben.hohn at linutronix.de
Mon May 25 15:14:11 CEST 2020


On Mon, May 18, 2020 at 10:09:59AM -0400, Olivier Dion wrote:
> 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)

why dont you use TmpdirFilesystem ?
https://github.com/Linutronix/elbe/blob/master/elbepack/filesystem.py#L316


> +    tests.addTests(doctest.DocTestSuite(filesystem, extraglobs={"this":fs}))
> +
>      return tests
> -- 
> 2.26.2
> 
> 
> _______________________________________________
> elbe-devel mailing list
> elbe-devel at linutronix.de
> https://lists.linutronix.de/mailman/listinfo/elbe-devel

-- 
Torben Hohn
Linutronix GmbH | Bahnhofstrasse 3 | D-88690 Uhldingen-Mühlhofen
Phone: +49 7556 25 999 18; Fax.: +49 7556 25 999 99

Hinweise zum Datenschutz finden Sie hier (Informations on data privacy 
can be found here): https://linutronix.de/kontakt/Datenschutz.php

Linutronix GmbH | Firmensitz (Registered Office): Uhldingen-Mühlhofen | 
Registergericht (Registration Court): Amtsgericht Freiburg i.Br., HRB700 
806 | Geschäftsführer (Managing Directors): Heinz Egger, Thomas Gleixner



More information about the elbe-devel mailing list