[Tutor] Modules and Test Suites

Stephen Nelson-Smith sanelson at gmail.com
Tue Dec 29 16:11:42 CET 2009


I do quite a lot of programming in Ruby.  When I do so, my code tends
to have the following layout:

/path/to/src/my_project

Inside my_project:

lib/
test/
my_project.rb

my_project.rb uses classes and helper methods in lib

Inside test, I have a test suite that also uses classes and helper
methods in ../lib

This seems like a sensible way to keep tests and other code separate.

In Python I don't know how to do this.... so I just have all my tests
in the same place as the rest of the code.

a) Is my above way a sensible and pythonic approach?
b) If so - how can I do it in Python?
c) If not, is there a better way than having all the tests in the same
place as the rest of the code?

S.

-- 
Stephen Nelson-Smith
Technical Director
Atalanta Systems Ltd
www.atalanta-systems.com


More information about the Tutor mailing list