Skip to content
Snippets Groups Projects
Commit f7c69ba6 authored by Ned Batchelder's avatar Ned Batchelder
Browse files

test: suppress noise

The test suite was generating error log messages when tests would cause
error conditions.  This cluttered the output needlessly, because it
looked like test failures, but were actually tests succeeding.  Now all
log messages are suppresed during the test suite.

In addition, the XBlock runtime generates a warning about needing
IdGenerator in the future.  I'm suppressing this warning also.

Now the test suite just outputs 397 nice dots.
parent 3f33af79
No related branches found
No related tags found
No related merge requests found
...@@ -4,7 +4,9 @@ Run tests for the LTI Consumer XBlock ...@@ -4,7 +4,9 @@ Run tests for the LTI Consumer XBlock
""" """
import os import os
import logging
import sys import sys
import warnings
if __name__ == '__main__': if __name__ == '__main__':
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'test_settings') os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'test_settings')
...@@ -28,6 +30,12 @@ if __name__ == '__main__': ...@@ -28,6 +30,12 @@ if __name__ == '__main__':
settings.INSTALLED_APPS += ('lti_consumer',) settings.INSTALLED_APPS += ('lti_consumer',)
# Suppress logging: it just clutters the test output with error logs that are expected.
logging.disable(logging.CRITICAL)
# Suppress a warning from XBlock: "IdGenerator will be required in the future in order to support XBlockAsides"
warnings.filterwarnings("ignore", category=FutureWarning, message=r"IdGenerator will be required.*")
arguments = sys.argv[1:] arguments = sys.argv[1:]
options = [argument for argument in arguments if argument.startswith('-')] options = [argument for argument in arguments if argument.startswith('-')]
paths = [argument for argument in arguments if argument not in options] paths = [argument for argument in arguments if argument not in options]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment