On Thu, Apr 16, 2009 at 5:04 AM, Daniel Joshua Worth <pipemanmu...@gmail.com> wrote: > I'm trying to learn unit test and have a unit test for a model in test.py > and have a test set up to fail. > When I run manage.py test it returns that all tests are OK. > If I run manage.py test <module> it returns OK. > If I run manage.py test <module>.<unittest> it returns OK. > If I run manage.py test <module>.<unittest>.<test> if Fails. > What gives. Am I missing something as far as unittests are concerned? It > should Fail every time or it's not much of a test.
Without specifics it isn't possible to know the exact problem. However, my guess would be that the specific test that is failing is at fault - probably due to an external test dependency that is satisfied by a different test in your suite. The different ways of invoking test cases doesn't mean anything different from the perspective of the test itself. All you are specifying is the list of tests that will be exectued. If a test fails in isolation, but not in the suite, then the test is probably at fault. For example, say your suite has one test case with two tests, A and B. A creates an object X. In order for B to pass, X must exist. If you run both tests (either as the full suite, or as the test case), A runs before B, and X is available. If you just run B, then X isn't available, and the test fails. Yours, Russ Magee %-) --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---