Skip to content

Commit

Permalink
bpo-44514: Add doctest testcleanup for configparser and bz2 (python#2…
Browse files Browse the repository at this point in the history
…6909)

Add testcleanup section to configparser and bz2 documentation which
removes temporary files created in the filesystem when 'make doctest'
is run.
  • Loading branch information
kfollstad committed Jul 13, 2021
1 parent 2924bb1 commit 48a5aa7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Doc/library/bz2.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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")
5 changes: 5 additions & 0 deletions Doc/library/configparser.rst
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@ can be customized by end users easily.

import configparser

.. testcleanup::

import os
os.remove("example.ini")


Quick Start
-----------
Expand Down

0 comments on commit 48a5aa7

Please sign in to comment.