How to pass command line arguments from one python module to another
<p>I am writing a unittest for a module that accepts command line arguments. I've used optparse in the module to accept the args.</p>

<p>So when I execute the module directly I just type:-</p>

<pre><code>module.py -e 42 -g 84
</code></pre>

<p>So far in my unittest I simply create an instance of the module to test then call a specific method:-</p>

<pre><code>instance = module.className()
instance.method()
</code></pre>

<p>Can someone please tell me how to pass the command line args to module.py from another module such as a unittest?</p>

<p>Do I use optparse in my unittest and somehow incorporate in when generating the instance of module.py?</p>

<p>Thanks in advance.</p>
