[Python-Dev] I need help with IO testuite

Antoine Pitrou solipsis at pitrou.net
Wed Nov 17 15:44:15 CET 2010


On Wed, 17 Nov 2010 15:31:02 +0100
Jesus Cea <jcea at jcea.es> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Hi all. I am modifying IO module for Python 3.2, and I am unable to
> understand the mechanism used in IO testsuite to test both the C and the
> Python implementation.
> 
> In particular I need to test that the implementation passes some
> parameters to the OS.
> 
> The module uses "Mock" classes, but I think "Mock" is something else,
> and I don't see how it interpose between the C/Python code and the OS.

It doesn't interpose between Python and the OS: it mocks the OS.  It
is, therefore, a mock (!).

Consequently, if you want to test that parameters are passed to the OS,
you shouldn't use a mock, but an actual file. There are several tests
which already do that, it shouldn't be too hard to write your own.

Regards

Antoine.




More information about the Python-Dev mailing list