I utilize the standard python logging module. When I call python manage.py test
I'd like to disable logging before all the tests are ran. Is there a signal or some other kind of hook I could use to call logging.disable? Or is there some other way to disable logging when python manage.py test
is ran?
Running python manage.py test is the right way to run all the tests in your projects at once, your error is caused by something else. I think your problem is caused because you may have a tests folder within your tests folder, which is confusing unittest.
By default, the LOGGING setting is merged with Django's default logging configuration using the following scheme. If the disable_existing_loggers key in the LOGGING dictConfig is set to True (which is the dictConfig default if the key is missing) then all loggers from the default configuration will be disabled.
There is actually a much better way to do so, with django-nose there is a kwarg:
Just run:
./bin/manage.py test --logging-clear-handlers
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With