By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,033 Members | 1,952 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,033 IT Pros & Developers. It's quick & easy.

unittest dependencies

P: n/a
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
Share this Question
Share on Google+
1 Reply


P: n/a
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.