The "Background" section near the end of this post <http://web2py.com/AlterEgo/default/show/260> explains the general issue with unit tests. The rest of the post describes one possible approach, which is to use web2py to create the standard environment but change the way unit tests are executed.
Another approach is to run the unit tests as normal, but create a fake environment within the test setup. This approach is used by the web2py Test Runner <https://pythonhosted.org/web2py_utils/test_runner.html> module. Here are a couple of examples for implementing testing: https://github.com/viniciusban/web2py.test https://github.com/niphlod/welcome_augmented Also, web2py itself includes a basic functional testing module, described in the book: http://web2py.com/books/default/chapter/29/14/other-recipes#Functional-testing. Anthony On Tuesday, November 11, 2014 9:05:45 PM UTC-5, jjs0sbw wrote: > > Anthony: > > Would you be willing to share specific information about web2py testing > approaches. > > I plan on starting a web2py project early next year and would like to use > a TDD approach. > > What do you suggest? > > Have fun, > > Joe > > On Tue, Nov 11, 2014 at 9:18 AM, Anthony <[email protected]> wrote: > >> I think there is a confusion between third party *services* and third >> party *tools*. web2py has absolutely no problem accessing third party >> APIs (such as Google Analytics), and this will be exactly the same as you >> would handle things in other frameworks. The comment you found on SO has >> nothing to do with accessing external APIs. Instead, it refers to some >> complications that arise specifically when using third party unit testing >> tools due to the way web2py executes application code. In any case, that >> comment vastly overstates the difficulty. There are several recipes and >> existing libraries for doing testing in web2py, and once you understand how >> it works, it is not difficult to deal with (though admittedly not quite as >> straightforward as testing in other frameworks). Of course, there are many >> other areas in which web2py will make your life much easier. >> >> Anthony >> >> >> On Sunday, November 9, 2014 11:38:59 PM UTC-5, WhoSoLovesUs wrote: >>> >>> Hi, I'm in the beginning stages of building my app. >>> >>> One of the most important things it will do is connect to 3rd party >>> services via their APIs (e.g. Google Analytics) >>> >>> I ran into a disconcerting comment on this stackoverflow thread >>> <http://stackoverflow.com/questions/3646002/django-turbo-gears-web2py-which-is-better-for-what> >>> . >>> >>> To quote Mike A's comment >>> <http://stackoverflow.com/questions/3646002/django-turbo-gears-web2py-which-is-better-for-what#comment8500264_3648273> >>> : >>> >>> web2py has many good features, but be very wary of the global >>>> environment which becomes a real pain after a short time. It makes >>>> interacting with third-party tools like test-runners very difficult. >>>> Django >>>> is much more mature, being older than web2py, and has a much larger >>>> community and number of installations. >>> >>> >>> Can anyone here comment on this? Not being a programmer myself, I need >>> some more information about what this exactly means and why Mike would be >>> of this opinion. >>> >>> Thanks :) >>> >> -- >> Resources: >> - http://web2py.com >> - http://web2py.com/book (Documentation) >> - http://github.com/web2py/web2py (Source code) >> - https://code.google.com/p/web2py/issues/list (Report Issues) >> --- >> You received this message because you are subscribed to the Google Groups >> "web2py-users" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected]. >> For more options, visit https://groups.google.com/d/optout. >> > > > > -- > Joe Simpson > *"All that is gold does not glitter,**Not all those who wander are lost;**The > old that is strong does not wither,* > *Deep roots are not reached by the frost." J. R.R. Tolkien* > -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.

