Skip to content

Commit 105e6cd

Browse files
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 48a5aa7) Co-authored-by: Kevin Follstad <[email protected]>
1 parent c786988 commit 105e6cd

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

Doc/library/bz2.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -322,3 +322,8 @@ Writing and reading a bzip2-compressed file in binary mode:
322322
... content = f.read()
323323
>>> content == data # Check equality to original object after round-trip
324324
True
325+
326+
.. testcleanup::
327+
328+
import os
329+
os.remove("myfile.bz2")

Doc/library/configparser.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,11 @@ can be customized by end users easily.
4646

4747
import configparser
4848

49+
.. testcleanup::
50+
51+
import os
52+
os.remove("example.ini")
53+
4954

5055
Quick Start
5156
-----------

0 commit comments

Comments
 (0)