Remove nonrequired conditions

This commit is contained in:
usamasadiq
2021-02-01 16:30:47 +05:00
parent 842c8cfa80
commit dbfec8ee3c
3 changed files with 1 additions and 85 deletions

View File

@@ -32,12 +32,6 @@ from xmodule.errortracker import make_error_tracker
from .exceptions import InsufficientSpecificationError, InvalidLocationError
# The name of the type for patterns in re changed in Python 3.7.
try:
Pattern = re._pattern_type # pylint: disable=protected-access
except AttributeError:
Pattern = re.Pattern # pylint: disable=no-member
log = logging.getLogger('edx.modulestore')
new_contract('CourseKey', CourseKey)
@@ -905,7 +899,7 @@ class ModuleStoreRead(six.with_metaclass(ABCMeta, ModuleStoreAssetBase)):
"""
if isinstance(target, list):
return any(self._value_matches(ele, criteria) for ele in target)
elif isinstance(criteria, Pattern):
elif isinstance(criteria, re.Pattern):
return criteria.search(target) is not None
elif callable(criteria):
return criteria(target)

View File

@@ -158,13 +158,3 @@ def normalize_repr(func):
between worker processes.
"""
return reprwrapper(func)
# Decorator for skipping tests that are not ready to be run with Python 3.x.
# While we expect many tests to fail with Python 3.x as we transition, this
# is specifically for tests that rely on external or large scale fixes. It can
# be added to individual tests or test classes.
py2_only = pytest.mark.skipif(
sys.version_info > (3, 0),
reason="This test can only be run with Python 2.7, currently"
)