unittest dependencies

U

urielka

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?
 
U

Urban, Gabor

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: [email protected] [mailto:p[email protected]] On Behalf Of urielka
Sent: 2007. május 2. 23:10
To: (e-mail address removed)
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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,680
Members
48,796
Latest member
Greg L.

Latest Threads

Top