468,300 Members | 1,285 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,300 developers. It's quick & easy.

unittest dependencies

i am using unittest to test a project,and one thing i really want is a
way to say that test a depends on test b,so it need to run before it
and be successful in order to run this test.

i just wanted to know if anyone have done it before(i searched for it
but didn`t find something useful),i think it can be done easily using
a decorator that will run the test which is depend on and mark it as
successful,the only problem will be detecting circular test
dependencies,but that can be fixed by keeping all the functions that
the decorator have seen.

what do you guys think? did someone did it before?

May 2 '07 #1
1 1512
Hullo!

I have several questions about this problem. Do you have more test scripts using the unittest framework?

My blind idea would be the following: run test b first, and go forward when no errors are found. To do this you could change the TestRunner component. The official documentation is good enough.

Good luck,

Gabor Urban
NMC - ART

-----Original Message-----
From: py*****************************************@python .org [mailto:py***************************************** @python.org] On Behalf Of urielka
Sent: 2007. május 2. 23:10
To: py*********@python.org
Subject: unittest dependencies

i am using unittest to test a project,and one thing i really want is a
way to say that test a depends on test b,so it need to run before it
and be successful in order to run this test.

i just wanted to know if anyone have done it before(i searched for it
but didn`t find something useful),i think it can be done easily using
a decorator that will run the test which is depend on and mark it as
successful,the only problem will be detecting circular test
dependencies,but that can be fixed by keeping all the functions that
the decorator have seen.

what do you guys think? did someone did it before?

--
http://mail.python.org/mailman/listinfo/python-list
May 4 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by Will Stuyvesant | last post: by
reply views Thread by Remy Blank | last post: by
1 post views Thread by Thomas Heller | last post: by
41 posts views Thread by Roy Smith | last post: by
7 posts views Thread by Jorgen Grahn | last post: by
3 posts views Thread by David Vincent | last post: by
2 posts views Thread by Oleg Paraschenko | last post: by
reply views Thread by Chris Fonnesbeck | last post: by
1 post views Thread by Chris Fonnesbeck | last post: by
reply views Thread by NPC403 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.