refactor: pyupgrade second iteration (#27453)
This commit is contained in:
@@ -12,7 +12,7 @@ import abc
|
||||
import six
|
||||
|
||||
|
||||
class BaseBackend(six.with_metaclass(abc.ABCMeta, object)):
|
||||
class BaseBackend(metaclass=abc.ABCMeta):
|
||||
"""
|
||||
Abstract Base Class for event tracking backends.
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ class LoggerBackend(BaseBackend):
|
||||
been configured using the default python mechanisms.
|
||||
|
||||
"""
|
||||
super(LoggerBackend, self).__init__(**kwargs) # lint-amnesty, pylint: disable=super-with-arguments
|
||||
super().__init__(**kwargs) # lint-amnesty, pylint: disable=super-with-arguments
|
||||
|
||||
self.event_logger = logging.getLogger(name)
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ class MongoBackend(BaseBackend):
|
||||
|
||||
"""
|
||||
|
||||
super(MongoBackend, self).__init__(**kwargs) # lint-amnesty, pylint: disable=super-with-arguments
|
||||
super().__init__(**kwargs) # lint-amnesty, pylint: disable=super-with-arguments
|
||||
|
||||
# Extract connection parameters from kwargs
|
||||
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
"""Tests for Event tracker backend."""
|
||||
|
||||
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
# lint-amnesty, pylint: disable=missing-module-docstring
|
||||
|
||||
from unittest.mock import patch
|
||||
from django.test import TestCase
|
||||
from mock import patch
|
||||
|
||||
from common.djangoapps.track.backends.mongodb import MongoBackend
|
||||
|
||||
|
||||
class TestMongoBackend(TestCase): # lint-amnesty, pylint: disable=missing-class-docstring
|
||||
def setUp(self):
|
||||
super(TestMongoBackend, self).setUp() # lint-amnesty, pylint: disable=super-with-arguments
|
||||
super().setUp()
|
||||
self.mongo_patcher = patch('common.djangoapps.track.backends.mongodb.MongoClient')
|
||||
self.mongo_patcher.start()
|
||||
self.addCleanup(self.mongo_patcher.stop)
|
||||
|
||||
Reference in New Issue
Block a user