# HG changeset patch # User Victor Ng # Date 1219933103 14400 # Node ID 20bca08c0828caedee7fe5ab1e3a364afa7bba3e # Parent b761c26773a3c588644ab84a2e944c8fb68fabee ignore .orig files from hg revert added a test module with doctests in it diff -r b761c26773a3 -r 20bca08c0828 .hgignore --- a/.hgignore Thu Aug 28 10:10:10 2008 -0400 +++ b/.hgignore Thu Aug 28 10:18:23 2008 -0400 @@ -1,6 +1,8 @@ syntax: glob +*.orig *.pyc *.egg-info build dist + diff -r b761c26773a3 -r 20bca08c0828 examples/README.TXT --- a/examples/README.TXT Thu Aug 28 10:10:10 2008 -0400 +++ b/examples/README.TXT Thu Aug 28 10:18:23 2008 -0400 @@ -1,18 +1,25 @@ If you change directory into the 'project' directory, you should be able to run the nose test runner and get reasonable results. +Note that you *won't* be running your doctests unless you tell nose to do so. -Something like this: +As usual, you need to tell nose to run doctest test strings in modules that +contain standard test classes. + +A successful run should hit *7* test cases. - C:\dev\nosedjango\examples\project>nosetests -v --with-django + C:\dev\nosedjango\examples\project>nosetests -v --with-django --with-doctest --d + octest-tests --doctest-tests + Doctest: project.zoo.models ... ok + Doctest: project.zoo.models.Zoo ... ok + Doctest: project.zoo.models.Zoo.__str__ ... ok + Doctest: project.zoo.models.func ... ok + This is just a stub for a regular test method ... ok + Doctest: project.zoo.test_foo.blah ... ok project.tests.test_views.test_view_index ... ok ---------------------------------------------------------------------- - Ran 1 test in 0.047s + Ran 7 tests in 0.562s OK Destroying test database... - - C:\dev\nosedjango\examples\project> - - diff -r b761c26773a3 -r 20bca08c0828 examples/project/zoo/test_foo.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/examples/project/zoo/test_foo.py Thu Aug 28 10:18:23 2008 -0400 @@ -0,0 +1,12 @@ + +def test_regular_test_method(): + ''' This is just a stub for a regular test method''' + pass + +def blah(): + ''' + This is a doctest that might get skipped + + >>> 5 + 5 + 10 + '''