refactor: pyupgrade second iteration (#27453)

This commit is contained in:
Usama Sadiq
2021-05-10 13:48:34 +05:00
committed by GitHub
parent ea550c06a5
commit 2409ea22be
15 changed files with 76 additions and 77 deletions

View File

@@ -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.

View File

@@ -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)

View File

@@ -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

View File

@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
"""Tests for Event tracker backend."""

View File

@@ -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)