I have a Django unit test, and I want to put print statements in it for debugging purposes but apparently django is suppressing them. How else can I print the value of a variable? I may be able to hack around with asserts, etc. but wondering how people do this.
Asked
Active
Viewed 7,901 times
9
-
You might try looking at this post: http://stackoverflow.com/questions/1118183/how-to-debug-in-django-the-good-way – bitfish May 13 '13 at 23:27
-
1The answer lies in this post: http://stackoverflow.com/questions/1236285/how-do-i-see-stdout-when-running-django-tests – CppLearner May 14 '13 at 01:27
-
Have you tried [`pytest`](https://pytest.org/en/latest/)? It modifies the `assert` statement and prints the variables in the assertion for you, if a test fails. – Boris Verkhovskiy Sep 12 '19 at 14:34