예제 #1
0
파일: test.py 프로젝트: lipper/edx-platform
# objects. As a result, pylint applies the wrong regex in validating names,
# and throws spurious errors. Therefore, we disable invalid-name checking.
# pylint: disable=invalid-name

from .common import *
import os
from path import Path as path
from uuid import uuid4
from warnings import filterwarnings, simplefilter

from openedx.core.lib.tempdir import mkdtemp_clean

# This patch disables the commit_on_success decorator during tests
# in TestCase subclasses.
from util.testing import patch_testcase, patch_sessions
patch_testcase()
patch_sessions()

# Silence noisy logs to make troubleshooting easier when tests fail.
import logging
LOG_OVERRIDES = [
    ('factory.generate', logging.ERROR),
    ('factory.containers', logging.ERROR),
]
for log_name, log_level in LOG_OVERRIDES:
    logging.getLogger(log_name).setLevel(log_level)

# mongo connection settings
MONGO_PORT_NUM = int(os.environ.get('EDXAPP_TEST_MONGO_PORT', '27017'))
MONGO_HOST = os.environ.get('EDXAPP_TEST_MONGO_HOST', 'localhost')
예제 #2
0
# and throws spurious errors. Therefore, we disable invalid-name checking.
# pylint: disable=invalid-name

from .common import *
import os
from path import Path as path
from uuid import uuid4
from warnings import filterwarnings, simplefilter

from util.db import NoOpMigrationModules
from openedx.core.lib.tempdir import mkdtemp_clean

# This patch disables the commit_on_success decorator during tests
# in TestCase subclasses.
from util.testing import patch_testcase, patch_sessions
patch_testcase()
patch_sessions()

# Silence noisy logs to make troubleshooting easier when tests fail.
import logging
LOG_OVERRIDES = [
    ('factory.generate', logging.ERROR),
    ('factory.containers', logging.ERROR),
]
for log_name, log_level in LOG_OVERRIDES:
    logging.getLogger(log_name).setLevel(log_level)

# mongo connection settings
MONGO_PORT_NUM = int(os.environ.get('EDXAPP_TEST_MONGO_PORT', '27017'))
MONGO_HOST = os.environ.get('EDXAPP_TEST_MONGO_HOST', 'localhost')