]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-44514: Add doctest testcleanup for configparser and bz2 (GH-26909) (#27111)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Tue, 13 Jul 2021 14:33:50 +0000 (07:33 -0700)
committerGitHub <noreply@github.com>
Tue, 13 Jul 2021 14:33:50 +0000 (16:33 +0200)
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 <kfollstad@gmail.com>
Doc/library/bz2.rst
Doc/library/configparser.rst

index 637baf49da1fc0eaf0ec09163dc79f940a6c1360..b5c3277f7bbff11ec3eeb7c64153ccb0e80f969a 100644 (file)
@@ -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")
index 730d1df9614289747b7b39486ce821bb69a0776f..3de5918367ace463e4416e8f91a209a2a54d66e9 100644 (file)
@@ -46,6 +46,11 @@ can be customized by end users easily.
 
    import configparser
 
+.. testcleanup::
+
+   import os
+   os.remove("example.ini")
+
 
 Quick Start
 -----------