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

Passing arguments to subclasses of unittest.TestCase

P: n/a
Hi,

Is there a way to pass arguments to TestCases when running tests? I have
a test suite that need to be configured slightly differently for 3
different products, and rather than do a hack I wondered if there was a
canonical way to do it.

I _know_ that py.test can do it trivially. I am rather stuck with
unittest, as I have 84 testcases, and I have to make it work tomorrow.
--
Tom Harris BeacyBooks <beacybooks<AT>bigpond<DOT>com>

Nov 27 '07 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Tom Harris schrieb:
Hi,

Is there a way to pass arguments to TestCases when running tests? I have
a test suite that need to be configured slightly differently for 3
different products, and rather than do a hack I wondered if there was a
canonical way to do it.

I _know_ that py.test can do it trivially. I am rather stuck with
unittest, as I have 84 testcases, and I have to make it work tomorrow.
How about writing one test that takes arguments, and three test-methods
that invoke it with different arguments? Or need there be commandline
arguments or such stuff involved?

Diez
Nov 27 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.