mora mora - 2 years ago 140
Python Question

Is "test_code" in "python -m unittest test_code" argument of '-m' or argument of 'unittest'?

I am learning python unittest.
I would like to ask what the 'test_code' in the following code is.

python -m unittest test_code

Is it the argument of '-m' option or one of unittest?
I would like to know how the unittest works.

Thank you very much

Answer Source

Using unittest module you can run tests from modules in command line. While -m is a flag and is used to specify python that you would be using test methods of unittest.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download