refactor: switch from mock to unittest.mock (#34844)

As of Python 3.3, the 3rd-party `mock` package has been subsumed into the
standard `unittest.mock` package. Refactoring tests to use the latter will
allow us to drop `mock` as a dependency, which is currently coming in
transitively through requirements/edx/paver.in.

We don't actually drop the `mock` dependency in this PR. That will happen
naturally in:

* https://github.com/openedx/edx-platform/pull/34830
This commit is contained in:
Kyle McCormick
2024-05-22 13:52:24 -04:00
committed by GitHub
parent 749e18bcee
commit 11626148d9
30 changed files with 49 additions and 73 deletions

View File

@@ -2,12 +2,12 @@
Tests for edX API calls.
"""
import unittest
from unittest.mock import DEFAULT, patch
from urllib.parse import urljoin
import requests
import responses
from ddt import data, ddt, unpack
from mock import DEFAULT, patch
from requests.exceptions import ConnectionError, HTTPError
from responses import GET, PATCH, POST, matchers
from responses.registries import OrderedRegistry