Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use unittest.mock instead of the mock package #29323

Merged
merged 2 commits into from Jun 11, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion tools/ci/tc/tests/test_decision.py
@@ -1,4 +1,5 @@
import mock
from unittest import mock

import pytest

from tools.ci.tc import decision
Expand Down
2 changes: 1 addition & 1 deletion tools/ci/tc/tests/test_valid.py
@@ -1,8 +1,8 @@
import json
import os
from unittest import mock

import jsone
import mock
import pytest
import requests
import yaml
Expand Down
3 changes: 1 addition & 2 deletions tools/lint/tests/test_lint.py
@@ -1,8 +1,7 @@
import io
import os
import sys

import mock
from unittest import mock

from ...localpaths import repo_root
from .. import lint as lint_mod
Expand Down
2 changes: 1 addition & 1 deletion tools/lint/tests/test_path_lints.py
@@ -1,5 +1,5 @@
import mock
import os
from unittest import mock

from ..lint import check_path, check_unique_case_insensitive_paths
from .base import check_errors
Expand Down
3 changes: 1 addition & 2 deletions tools/manifest/tests/test_manifest.py
@@ -1,6 +1,5 @@
import os

import mock
from unittest import mock

import hypothesis as h
import hypothesis.strategies as hs
Expand Down
3 changes: 1 addition & 2 deletions tools/manifest/tests/test_utils.py
@@ -1,7 +1,6 @@
import os
import subprocess

import mock
from unittest import mock

from .. import utils

Expand Down
1 change: 0 additions & 1 deletion tools/requirements_pytest.txt
@@ -1,4 +1,3 @@
pytest==6.2.4
pytest-cov==2.12.1
mock==4.0.3
hypothesis==6.14.0
5 changes: 3 additions & 2 deletions tools/wpt/tests/test_browser.py
@@ -1,9 +1,10 @@
import logging
import inspect
import mock
import pytest
import subprocess
import sys
from unittest import mock

import pytest

from tools.wpt import browser

Expand Down
3 changes: 2 additions & 1 deletion tools/wpt/tests/test_revlist.py
@@ -1,4 +1,5 @@
import mock
from unittest import mock

from tools.wpt import revlist


Expand Down
2 changes: 1 addition & 1 deletion tools/wpt/tests/test_run.py
@@ -1,7 +1,7 @@
import mock
import tempfile
import shutil
import sys
from unittest import mock

import pytest

Expand Down
2 changes: 1 addition & 1 deletion tools/wpt/tests/test_testfiles.py
@@ -1,5 +1,5 @@
import os.path
from mock import patch
from unittest.mock import patch

from tools.manifest.manifest import Manifest
from tools.wpt import testfiles
Expand Down
2 changes: 1 addition & 1 deletion tools/wptrunner/wptrunner/tests/browsers/test_sauce.py
@@ -1,7 +1,7 @@
import logging
import sys
from unittest import mock

import mock
import pytest

from os.path import join, dirname
Expand Down
2 changes: 1 addition & 1 deletion tools/wptrunner/wptrunner/tests/test_products.py
@@ -1,6 +1,6 @@
from os.path import join, dirname
from unittest import mock

import mock
import pytest

from .base import all_products, active_products
Expand Down
5 changes: 3 additions & 2 deletions tools/wptrunner/wptrunner/tests/test_update.py
@@ -1,9 +1,10 @@
import json
import mock
import os
import pytest
import sys
from io import BytesIO
from unittest import mock

import pytest

from .. import metadata, manifestupdate
from ..update.update import WPTUpdate
Expand Down
2 changes: 1 addition & 1 deletion tools/wptrunner/wptrunner/tests/test_wpttest.py
@@ -1,5 +1,5 @@
import mock
from io import BytesIO
from unittest import mock

from manifest import manifest as wptmanifest
from manifest.item import TestharnessTest, RefTest
Expand Down
2 changes: 1 addition & 1 deletion tools/wptserve/tests/test_request.py
@@ -1,4 +1,4 @@
import mock
from unittest import mock

from wptserve.request import Request, RequestHeaders, MultiDict

Expand Down
2 changes: 1 addition & 1 deletion tools/wptserve/tests/test_response.py
@@ -1,5 +1,5 @@
import mock
from io import BytesIO
from unittest import mock

from wptserve.response import Response

Expand Down