Hi,<br><br>I have just started to get into the habit of testing everything that I code, and a good friend of mine suggested the coverage plugin when using Nosetests.<br><br>Right now I am working on a Daemon module for Python scripts. The module, when imported will make the current process detach from the terminal and run in the background as a daemon.<br>
<br>When trying to test the module (importing it to test_module.py) I fail to correctly test any actions since it will convert test_module.py into a daemon.<br><br>To circumvent this problem I created a &quot;daemon script&quot; (test_script.py) that would import the daemon module and effectively run in the background.<br>
<br>The tests would check upon this daemon and the actions the module should be doing when working correctly (write to a file, kill a process etc).<br><br>And this solution works fine for testing, but the &quot;--with-coverage&quot; flag does not cover the daemon module at all.<br>
<br>When going further and specifying the package with &quot;--cover-package=daemonModule&quot; I get 0% coverage. I&#39;m thinking this is expected since I am not importing the daemon module within test_module.py but rather on the daemon test script (test_script.py).<br>
<br>And just to avoid some confusion, this is what I have:<br>test_script.py =&gt; Script that will correctly daemonize so I can test behavior  <br>test_module.py =&gt; Where all the tests go. Can&#39;t import the daemon module here or this will detach from the terminal.<br>
<br>Do you guys know any other way that I could effectively test the daemon while still being able to maintain the Coverage plugin with a nice percentage value?<br><br><br>Thanks,<br><br><br>Alfredo<br>