From 105e6cd67cc793c971b3e83daa87d36516fcba28 Mon Sep 17 00:00:00 2001 From: "Miss Islington (bot)" <31488909+miss-islington@users.noreply.github.com> Date: Tue, 13 Jul 2021 07:33:50 -0700 Subject: [PATCH] bpo-44514: Add doctest testcleanup for configparser and bz2 (GH-26909) (#27111) Add testcleanup section to configparser and bz2 documentation which removes temporary files created in the filesystem when 'make doctest' is run. (cherry picked from commit 48a5aa7f128caf5a46e4326c1fd285cd5fc8e59d) Co-authored-by: Kevin Follstad --- Doc/library/bz2.rst | 5 +++++ Doc/library/configparser.rst | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/Doc/library/bz2.rst b/Doc/library/bz2.rst index 637baf49da1f..b5c3277f7bbf 100644 --- a/Doc/library/bz2.rst +++ b/Doc/library/bz2.rst @@ -322,3 +322,8 @@ Writing and reading a bzip2-compressed file in binary mode: ... content = f.read() >>> content == data # Check equality to original object after round-trip True + +.. testcleanup:: + + import os + os.remove("myfile.bz2") diff --git a/Doc/library/configparser.rst b/Doc/library/configparser.rst index 730d1df96142..3de5918367ac 100644 --- a/Doc/library/configparser.rst +++ b/Doc/library/configparser.rst @@ -46,6 +46,11 @@ can be customized by end users easily. import configparser +.. testcleanup:: + + import os + os.remove("example.ini") + Quick Start ----------- -- 2.47.3