This would be an useful recipe to put in the docs. -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Roberto De Ioris Sent: 16. kesäkuuta 2014 11:30 To: uWSGI developers and users list Subject: Re: [uWSGI] Running unit test error
> Hi guys, > Under development mode, I would like to run django unit test cases > like so > : > %(virtualenv)/bin/python %(chdir)/manage.py test > --liveserver=localhost:8423-9078 fooapp as a cron command under a > separate standalone uwsgi process. > I have an error message : ImportError: No module named uwsgi > On the side, i have another uwsgi process running the development > django webserver(i.e. runserver ...) I would like the uwsgi process > running test cases to bug me(ie show error > messages) as soon as a test case fails as soon as there codes changes > on the second uwsgi running the django webserver. > I saw on the internet somewhere, where you could define a python > generator which catches the 'import error' and justcalls the called function. > Could you have any suggestions of running test cases under uwsgi for > django or anything. > Thank you guys for you work, > Richard > *** Starting uWSGI 2.0.5.1 (64bit) on [Sun Jun 15 20:59:00 2014] > ***compiled with version: 4.2.1 Compatible FreeBSD Clang 3.3 > (tags/RELEASE_33/final 183502) on 02 June 2014 13:38:15os: > FreeBSD-10.0-RELEASE-p12 FreeBSD 10.0-RELEASE-p12 #0: Wed Jun 4 > 14:50:48 UTC 2014 > [email protected]:/usr/obj/usr/src/sys/GENERICmachine: > amd64clock source: unixpcre jit disableddetected number of CPU cores: 2 > _______________________________________________ > Would not be easier to use uWSGI as the development server ? Add --py-autoreload=n to enabel auto-reloading on code changes, and add a hook to call the test suite at every change (instead of cron): [uwsgi] ... py-autoreload = 1 hook-post-app = cmd:%(virtualenv)/bin/python %(chdir)/manage.py test --liveserver=localhost:8423-9078 fooapp with those 2 options combined, your instance will die as soon as the test fails -- Roberto De Ioris http://unbit.it _______________________________________________ uWSGI mailing list [email protected] http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi _______________________________________________ uWSGI mailing list [email protected] http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi
