Add a testing utility for pre-generating temp directories.

Review Request #12095 — Created Feb. 28, 2022 and submitted — Latest diff uploaded

Information

RBTools
master

Reviewers

This introduces TestCase.precreate_tempdirs(), which will pre-create
the specified number of temp directories, spy on make_tempdir() to
return them in order, and then immediately return them to the caller.

This allows unit tests to better work with code paths that make use of
make_tempdir(), ensuring the right results, and even pre-populating
files within them.

Made use of this in unit tests for an in-development SCM.

Diff Revision 1 (Latest)

Commits

First Last Summary ID Author
Add a testing utility for pre-generating temp directories.
This introduces `TestCase.precreate_tempdirs()`, which will pre-create the specified number of temp directories, spy on `make_tempdir()` to return them in order, and then immediately return them to the caller. This allows unit tests to better work with code paths that make use of `make_tempdir()`, ensuring the right results, and even pre-populating files within them.
58cfe69dfc32208d3e1d2332da3807cfeabcf08a Christian Hammond
rbtools/testing/testcase.py
Loading...