Skip to content

Commit

Permalink
remove usage of old mock (#513)
Browse files Browse the repository at this point in the history
  • Loading branch information
a-detiste authored Mar 22, 2024
1 parent 87952dc commit f5d3c97
Show file tree
Hide file tree
Showing 11 changed files with 12 additions and 11 deletions.
2 changes: 1 addition & 1 deletion dbbackup/tests/commands/test_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
import logging
import os
from io import BytesIO
from unittest.mock import patch

from django.core.files import File
from django.test import TestCase
from mock import patch

from dbbackup.management.commands._base import BaseDbBackupCommand
from dbbackup.storage import get_storage
Expand Down
2 changes: 1 addition & 1 deletion dbbackup/tests/commands/test_listbackups.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from io import StringIO
from unittest.mock import patch

from django.core.management import execute_from_command_line
from django.test import TestCase
from mock import patch

from dbbackup.management.commands.listbackups import Command as ListbackupsCommand
from dbbackup.storage import get_storage
Expand Down
2 changes: 1 addition & 1 deletion dbbackup/tests/functional/test_commands.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import os
import tempfile
from unittest.mock import patch

from django.conf import settings
from django.core.management import execute_from_command_line
from django.test import TransactionTestCase as TestCase
from mock import patch

from dbbackup.tests.testapp import models
from dbbackup.tests.utils import (
Expand Down
3 changes: 2 additions & 1 deletion dbbackup/tests/test_checks.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from unittest.mock import patch

from django.test import TestCase
from mock import patch

try:
from dbbackup import checks
Expand Down
2 changes: 1 addition & 1 deletion dbbackup/tests/test_connectors/test_mongodb.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from io import BytesIO
from unittest.mock import patch

from django.test import TestCase
from mock import patch

from dbbackup.db.mongodb import MongoDumpConnector

Expand Down
2 changes: 1 addition & 1 deletion dbbackup/tests/test_connectors/test_mysql.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from io import BytesIO
from unittest.mock import patch

from django.test import TestCase
from mock import patch

from dbbackup.db.mysql import MysqlDumpConnector

Expand Down
2 changes: 1 addition & 1 deletion dbbackup/tests/test_connectors/test_sqlite.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from io import BytesIO
from unittest.mock import mock_open, patch

from django.db import connection
from django.test import TestCase
from mock import mock_open, patch

from dbbackup.db.sqlite import SqliteConnector, SqliteCPConnector
from dbbackup.tests.testapp.models import CharModel
Expand Down
2 changes: 1 addition & 1 deletion dbbackup/tests/test_log.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import logging
from unittest.mock import patch

import django
from django.core import mail
from django.test import TestCase
from mock import patch
from testfixtures import log_capture

from dbbackup import log
Expand Down
3 changes: 2 additions & 1 deletion dbbackup/tests/test_storage.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from unittest.mock import patch

from django.test import TestCase
from mock import patch

from dbbackup import utils
from dbbackup.storage import Storage, get_storage
Expand Down
2 changes: 1 addition & 1 deletion dbbackup/tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
import tempfile
from datetime import datetime
from io import StringIO
from unittest.mock import patch

import django
import pytz
from django.core import mail
from django.test import TestCase
from mock import patch

from dbbackup import settings, utils
from dbbackup.tests.utils import (
Expand Down
1 change: 0 additions & 1 deletion requirements/tests.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
coverage
django-storages
flake8
mock
pep8
psycopg2
pylint
Expand Down

0 comments on commit f5d3c97

Please sign in to comment.