Skip to content

Commit 48a5aa7

Browse files
authored
bpo-44514: Add doctest testcleanup for configparser and bz2 (#26909)
Add testcleanup section to configparser and bz2 documentation which removes temporary files created in the filesystem when 'make doctest' is run.
1 parent 2924bb1 commit 48a5aa7

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
@@ -325,3 +325,8 @@ Writing and reading a bzip2-compressed file in binary mode:
325325
... content = f.read()
326326
>>> content == data # Check equality to original object after round-trip
327327
True
328+
329+
.. testcleanup::
330+
331+
import os
332+
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)