On Thursday, 20 February 2014 00:35:43 UTC+5:30, Andrew Pashkin wrote:
>
> BTW - I recent;y trid to run Django test suite with Py.test and 
> pytest-django plugin and achived some success - main problem, that some 
> tests are failing and reason of it is not clear to me yet.
> This solution require pytest, django-pytest packages and lightweight 
> configuration.
> See patch in attachment. I was tested it with Django 1.4.10. Command that 
> I used: 
> PYTHONPATH=..:$PYTHONPATH py.test
>
>  
Even other errors raised are usually those which are in some way 
incompatible with Py.test. 
(I am just sampling some random tests from the 177+57 failing tests, and 
looking at the reason) 

For example -> 
Look at this code slice from  test_utils/tests.py:196

def test_failure(self):
        with self.assertRaises(AssertionError) as exc_info:
            with self.assertNumQueries(2):
                Person.objects.count()
        self.assertIn("1 queries executed, 2 expected", 
str(exc_info.exception))
        self.assertIn("Captured queries were", str(exc_info.exception))

Now, to catch the assertion in Py.Test we ought to use pytest.raises() 
instead of unittest.assertRaises().

Since we are not using that, it fails at the uncaught exception 
assertNumQueries(2).

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/b21dd7e7-01b2-45ad-94a1-2e0d177e394d%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to