aboutsummaryrefslogtreecommitdiff
path: root/devel/py-pyfakefs/pkg-descr
blob: 4e82fbb5cd45ce6219d7cb8061f0030b1059de01 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
pyfakefs implements a fake file system that mocks the Python file system
modules. Using pyfakefs, your tests operate on a fake file system in memory
without touching the real disk. The software under test requires no modification
to work with pyfakefs.

Pyfakefs creates a new empty in-memory file system at each test start, which
replaces the real filesystem during the test. Think of pyfakefs as making a
per-test temporary directory, except for an entire file system.

There are several means to achieve this: by using the fs fixture if running
pytest, by using fake_filesystem_unittest.TestCase as a base class if using
unittest, by using a fake_filesystem_unittest.Patcher instance as a context
manager, or by using the patchfs decorator.