[Twisted-Python] Several Trial test suites

Hello, I am using Twisted and Trial with great success for a project where we would like to have both a small regression test suite that should run quickly and a larger test suite which will test the system under more heavy load. My project lives in a package called viff, and so far I have created a viff.test package which contains the tests -- no problem, the test are picked up fine when I do 'trial viff'. To create a secondary test suite, do I have to create another package at the viff level, say viff.stress_test, or is there some clever way to organize things below viff.test? How to people organize such trees with many tests? Thanks for any inputs! -- Martin Geisler VIFF (Virtual Ideal Functionality Framework) brings easy and efficient SMPC (Secure Multi-Party Computation) to Python. See: http://viff.dk/.

On Feb 13, 2008 1:30 AM, Martin Geisler <mg@daimi.au.dk> wrote:
Hi Martin, I'm not sure I understand your problem entirely, but I'll let you know what I do. My code lives in a package called 'foo'. Underneath that I have a package called 'tests' that contains all my tests as 'test_*.py' files. 'trial foo' runs all the tests. If I wanted to have two different suites, say for unit tests and integration tests, I might make another package beneath 'foo' called 'integrationtests'. If I felt a bit crazy that day, I might instead move all of my unit tests to foo/tests/unit/ and all of my integration tests to foo/tests/integration/. The important things to remember are: - Trial recurses down the Python module/package tree and treats anything called 'test_*' as a possible location for tests. - You can specify any fully-qualified Python name on the command line. - There is no option to specifically exclude certain tests. - You can define a test_suite() (or testSuite()) hook in a test module if you want to do something fancy. jml

"Jonathan Lange" <jml@mumak.net> writes: Hi Jonathan
I'm not sure I understand your problem entirely, but I'll let you know what I do.
Yeah, I guess I was a bit vague -- I was just wondering how best to structure many tests so that I have good flexibility over what to run and when to run it.
That is a good idea, I think I'll group my tests similarly so that I can easily run all tests or just selected subsets.
Okay, that was what I initially sought for. Thanks for the input! -- Martin Geisler VIFF (Virtual Ideal Functionality Framework) brings easy and efficient SMPC (Secure Multi-Party Computation) to Python. See: http://viff.dk/.

On Feb 13, 2008 1:30 AM, Martin Geisler <mg@daimi.au.dk> wrote:
Hi Martin, I'm not sure I understand your problem entirely, but I'll let you know what I do. My code lives in a package called 'foo'. Underneath that I have a package called 'tests' that contains all my tests as 'test_*.py' files. 'trial foo' runs all the tests. If I wanted to have two different suites, say for unit tests and integration tests, I might make another package beneath 'foo' called 'integrationtests'. If I felt a bit crazy that day, I might instead move all of my unit tests to foo/tests/unit/ and all of my integration tests to foo/tests/integration/. The important things to remember are: - Trial recurses down the Python module/package tree and treats anything called 'test_*' as a possible location for tests. - You can specify any fully-qualified Python name on the command line. - There is no option to specifically exclude certain tests. - You can define a test_suite() (or testSuite()) hook in a test module if you want to do something fancy. jml

"Jonathan Lange" <jml@mumak.net> writes: Hi Jonathan
I'm not sure I understand your problem entirely, but I'll let you know what I do.
Yeah, I guess I was a bit vague -- I was just wondering how best to structure many tests so that I have good flexibility over what to run and when to run it.
That is a good idea, I think I'll group my tests similarly so that I can easily run all tests or just selected subsets.
Okay, that was what I initially sought for. Thanks for the input! -- Martin Geisler VIFF (Virtual Ideal Functionality Framework) brings easy and efficient SMPC (Secure Multi-Party Computation) to Python. See: http://viff.dk/.
participants (2)
-
Jonathan Lange
-
Martin Geisler