reading argv argument of unittest.main()

W

winston.yang

I've read that unittest.main() can take an optional argv argument, and
that if it is None, it will be assigned sys.argv.

Is there a way to pass command line arguments through unittest.main()
to the setUp method of a class derived from unittest.TestCase?

Thank you in advance.

Winston
 
G

Gabriel Genellina

I've read that unittest.main() can take an optional argv argument, and
that if it is None, it will be assigned sys.argv.

Is there a way to pass command line arguments through unittest.main()
to the setUp method of a class derived from unittest.TestCase?

Can't you use sys.argv[] directly inside setUp()?
 

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

Forum statistics

Threads
473,754
Messages
2,569,528
Members
45,000
Latest member
MurrayKeync

Latest Threads

Top