]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-44514: Add doctest testcleanup for configparser and bz2 (GH-26909) (GH-27112)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Tue, 13 Jul 2021 14:34:10 +0000 (07:34 -0700)
committerGitHub <noreply@github.com>
Tue, 13 Jul 2021 14:34:10 +0000 (16:34 +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 f6787ab120ed574156b3f33e07aa8ee572084f4b..999892e95f47152ba3d3bc526a6933552194a102 100644 (file)
@@ -325,3 +325,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 b0c2a2cfb06a47886ed293042f871cc4efc0a845..2bb425930bba7f854f4c6c4b6a4a8dee6d0b13b5 100644 (file)
@@ -46,6 +46,11 @@ can be customized by end users easily.
 
    import configparser
 
+.. testcleanup::
+
+   import os
+   os.remove("example.ini")
+
 
 Quick Start
 -----------