[TIP] [newbie] Does nosier support unittest?
Dan Knierim
dan_knierim at hotmail.com
Sun Nov 25 21:29:17 PST 2012
Hello Python Testers,
I just installed nosier, and bumped into an issue running unittest-based tests with it.
----- begin install session excerpt -----
root# pip install nosier
Downloading/unpacking nosier
Downloading nosier-1.1.tar.gz
Running setup.py egg_info for package nosier
Requirement already satisfied (use --upgrade to upgrade): inotifyx in /home/dknierim/.local/lib/python2.7/site-packages (from nosier)
Installing collected packages: nosier
Running setup.py install for nosier
Installing nosier script to /usr/local/bin
Successfully installed nosier
Cleaning up...
root#
----- end install session excerpt -----
----- begin nosier use session excerpt -----
dknierim$ cd ~/Project/tests
dknierim$ tail -5 test_convert_html.py
############################################################
if __name__ == '__main__':
unittest.main()
dknierim$ python test_convert_html.py
ssssssssssssssssssssss......s
----------------------------------------------------------------------
Ran 29 tests in 0.008s
OK (skipped=23)
dknierim$ nosier -ar python
Setting up monitoring of paths
Monitoring 13 paths
...[nosier apparently waiting for change in monitored files]...
...[I re-saved the test file ~/Project/tests/test_convert_html.py without changes in a separate session]...
================================================================================
Run Number : 1
Files : ./test_convert_html.py ./4913
Command : python ./test_convert_html.py ./4913
Traceback (most recent call last):
File "./test_convert_html.py", line 1178, in <module>
unittest.main()
File "/usr/lib/python2.7/unittest/main.py", line 94, in __init__
self.parseArgs(argv)
File "/usr/lib/python2.7/unittest/main.py", line 149, in parseArgs
self.createTests()
File "/usr/lib/python2.7/unittest/main.py", line 158, in createTests
self.module)
File "/usr/lib/python2.7/unittest/loader.py", line 128, in loadTestsFromNames
suites = [self.loadTestsFromName(name, module) for name in names]
File "/usr/lib/python2.7/unittest/loader.py", line 100, in loadTestsFromName
parent, obj = obj, getattr(obj, part)
AttributeError: 'module' object has no attribute ''
--------------------------------------------------------------------------------
...[nosier waiting]...
...[killed with Ctl-C]...
dknierim$ python -V
Python 2.7.2+
dknierim$ uname -a
Linux HPPavilionDV9723cl 3.0.0-27-generic #44-Ubuntu SMP Tue Oct 16 16:53:47 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux
----- end session excerpt -----
I've tried a few things, but before I go on and on --
Does nosier support unittest? Are there any special configuration requirements for using them together?
If nosier does support unittest, what are the first troubleshooting steps I should try?
Where else should I look for info on nosier?
Thanks,
Dan K.
More information about the testing-in-python
mailing list