[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:

http://systemfixtures.readthedocs.io/en/latest/#filesystem
https://github.com/testing-cabal/systemfixtures

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
   self.setUpPyfakefs()

2) there's no dependency on Python mock

Free



More information about the testing-in-python mailing list