[TIP] mocking a file in /proc

James Cooke me at jamescooke.info
Thu Jan 26 11:05:02 PST 2017


Hello,

That package looks really helpful - thanks for the tip Free. From
reading the docs, its API looks simpler than pyfakefs's - hopefully I
can try it out soon.

James




On Tue, 24 Jan 2017, at 02:58 PM, Free Ekanayaka wrote:
> 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


-- 
James Cooke
Backend software developer
CV PDF: http://jamescooke.info/docs/james_cooke_cv.pdf
Website: http://jamescooke.info/



More information about the testing-in-python mailing list