From 4949f7e0bddf6d1e7f85ac9afbc60b833afd8d2c Mon Sep 17 00:00:00 2001 From: "jon.crall" Date: Wed, 20 Jan 2021 14:02:44 -0500 Subject: [PATCH] Fix bug with doctest references --- CHANGELOG.md | 7 ++++++- xdoctest/doctest_example.py | 4 ++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c2182b9b..1a251117 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,9 +5,14 @@ We are currently working on porting this changelog to the specifications in This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## Version 0.15.1 - Unreleased +## Version 0.15.2 - Unreleased + +### Fixed +* Bug where references to doctest variables were never released +## Version 0.15.1 - Unreleased + ### Added * Documentation improvements * Minor text fixes diff --git a/xdoctest/doctest_example.py b/xdoctest/doctest_example.py index 22534658..0703636d 100644 --- a/xdoctest/doctest_example.py +++ b/xdoctest/doctest_example.py @@ -715,6 +715,10 @@ def run(self, verbose=None, on_error=None): pytest.skip() summary = self._post_run(verbose) + + # Clear the global namespace so doctests don't leak memory + self.global_namespace.clear() + return summary @property