[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[pygame] TODO: add pygame unittests, and test runner stuff to pygame.test package.



hi,

what do you think of a pygame.test package?


Here's an idea Nicholas and I have been discussing for adding the
pygame unittests, and test framework into a pygame module.

We haven't really threshed out the ideas fully yet, but here are the
notes for further discussion.



>>> # load the various tests.
>>> pygame.test.load()

>>> # run the tests.
>>> pygame.test.run()

>>> # module for generating stubs for untested code.
>>> pygame.test.gen_stubs

That is, making the tests a package of pygame.


Why?
=====
- people can run the tests to see if everything works in their own programs.
    - So you could for example run the tests on a persons computer to
see if everything in pygame+ your program is working.
    - you could also test which driver/function combination works, or
works fastest.
- it would make testing a py2exe/pyapp generated binary much easier.
- other people can use our testing framework enhancements for their own tests.
- would make bug reporting easier.  Since everyone could run
unittests, since they will be installed everywhere pygame is
installed.
- would allow unittest result submission easy.  This would result in a
much larger base of computers running the unittests and submitting
problems.  This would be opt in of course.
- make the testing stuff more a library, than a framework.
- allow people submit unittests more easily.  Since they won't require
a source release of pygame to write unittests.  eg people using a
windows binary install of pygame, or a ubuntu binary install can run
and submit unittests.



How will it affect writing tests?
======================

Hopefully it won't.  Tests will be written as they are now.

Probably have to make the tests not rely on data in examples/data
directory like some do.

Will allow more people to write unittests.  Since they won't need the
source install of pygame.



How do you plan to implement it?
========================

Not sure yet.

keep the test directory as it is now... basically on install... make a
copy of it?

Will need to move some stuff around.  Probably move some stuff into a
lib/test/ directory.