]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-44514: Add doctest testcleanup for configparser and bz2 (#26909)
authorKevin Follstad <kfollstad@gmail.com>
Tue, 13 Jul 2021 13:57:05 +0000 (06:57 -0700)
committerGitHub <noreply@github.com>
Tue, 13 Jul 2021 13:57:05 +0000 (15:57 +0200)
Add testcleanup section to configparser and bz2 documentation which
removes temporary files created in the filesystem when 'make doctest'
is run.

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
 -----------