problem with testing for DeprecationWarning

37 views
Skip to first unread message

Erik Romijn

unread,
Mar 1, 2014, 4:51:21 AM3/1/14
to django-d...@googlegroups.com
Hello,

I've started working on #22130, the deprecation of fix_ampersands, but I'm running into some trouble with building the tests. I imagine there's someone on this list with more experience in this, who might be able to help.

My current patch is at https://github.com/erikr/django/compare/deprecate-fix-ampersands?expand=1

The issue is that when running the full test suite, my test to assert that warnings are being issued, fails:
======================================================================
FAIL: test_fix_ampersands (utils_tests.test_html.TestUtilsHtml)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/erik/dev/django/tests/utils_tests/test_html.py", line 157, in test_fix_ampersands
self.assertEqual(len(w), 18)
AssertionError: 0 != 18

----------------------------------------------------------------------

Curiously, when I run this test independently, or when I run utils_tests independently, this test succeeds. Perhaps there is some interaction with other tests in the suite?

Direct link to the test in question:
https://github.com/erikr/django/compare/deprecate-fix-ampersands?expand=1#diff-adcabff46f848a5dece079381c6d9485R134

I've mostly looked at existing tests for deprecation for my modifications of this one - perhaps there's something I've overlooked that might cause my problem. If anyone could have a look, it would be much appreciated :)

cheers,
Erik

Aymeric Augustin

unread,
Mar 1, 2014, 4:59:23 AM3/1/14
to django-d...@googlegroups.com
On 1 mars 2014, at 10:51, Erik Romijn <ero...@solidlinks.nl> wrote:

> Curiously, when I run this test independently, or when I run utils_tests independently, this test succeeds. Perhaps there is some interaction with other tests in the suite?

If that’s the problem, ./runtests.py --bisect utils_tests should tell you which test interacts badly with your changes.

I hope this helps,

--
Aymeric.




Reply all
Reply to author
Forward
0 new messages