From 1fb0b566ed77c626686f8048a4e6f3d45e1dee05 Mon Sep 17 00:00:00 2001 From: Sergey B Kirpichev Date: Sat, 4 Nov 2023 09:00:13 +0300 Subject: [PATCH] Set doctest_global_cleanup sphinx directive --- docs/conf.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/docs/conf.py b/docs/conf.py index 782ad97a..06007088 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -79,3 +79,11 @@ ('index', 'gmpy2', 'gmpy2 Documentation', ['Case Van Horsen'], 3) ] + +# Python code that is treated like it were put in a testcleanup directive +# for *every* file that is tested, and for every group. +doctest_global_cleanup = """ +import gmpy2 + +gmpy2.set_context(gmpy2.context()) +"""