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

Torben Hohn torben.hohn at linutronix.de
Wed Jun 3 10:56:25 CEST 2020


On Mon, May 25, 2020 at 02:25:55PM -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>

Reviewed-by: Torben Hohn <torben.hohn 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
> 
> 
> _______________________________________________
> 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