[TIP] mocking a file in /proc

Free Ekanayaka free at ekanayaka.io
Tue Jan 24 06:58:43 PST 2017

James Cooke <me at jamescooke.info> writes:

> Hello,
> My suggestion is that you checkout pyfakefs:
> https://github.com/jmcgeheeiv/pyfakefs |
> https://pypi.python.org/pypi/pyfakefs

I didn't know about pyfakes.

FWIW systemfixtures seem to do the same:


The main differences I could see are:

1) systemfixtures uses composition instead of inheritance, i.e. you
   can call self.useFixture(FakeFilesystem()) instead of inheriting
   from fake_filesystem_unittest.TestCase and calling

2) there's no dependency on Python mock


More information about the testing-in-python mailing list