Skip to content

Drop mock dependency #6723

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

Merged
merged 4 commits into from
Mar 5, 2020
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ This version has two major changes:
* It updates our default docker images to stable=5.0 and latest=6.0.
* It changes our PR builder domain to `readthedocs.build`

* `@gallowayj <https://github.com/gallowayj>`__: Drop mock as a dependency (`#6665 <https://github.com/readthedocs/readthedocs.org/pull/6665>`__)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is actually auto generated. So, I think we don't need to add this here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@saadmk11 Sorry, should I cancel the pull requestion and resubmit a new pull request with the changes add to CHANGELOG.rst?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No. Just remove this line and push it to the branch and the PR will be updated

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@saadmk11 Thanks, I've removed that line and pushed the changes back to the branch.

* `@humitos <https://github.com/humitos>`__: Use PUBLIC_DOMAIN_USES_HTTPS for resolver tests (`#6673 <https://github.com/readthedocs/readthedocs.org/pull/6673>`__)
* `@stsewd <https://github.com/stsewd>`__: Always run CoreTagsTests with http (`#6671 <https://github.com/readthedocs/readthedocs.org/pull/6671>`__)
* `@ericholscher <https://github.com/ericholscher>`__: Remove old docker settings (`#6670 <https://github.com/readthedocs/readthedocs.org/pull/6670>`__)
Expand Down
2 changes: 1 addition & 1 deletion readthedocs/config/tests/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from collections import OrderedDict

import pytest
from mock import DEFAULT, patch
from unittest.mock import DEFAULT, patch
from pytest import raises

from readthedocs.config import (
Expand Down
2 changes: 1 addition & 1 deletion readthedocs/config/tests/test_validation.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import os

from mock import patch
from unittest.mock import patch
from pytest import raises

from readthedocs.config.validation import (
Expand Down
2 changes: 1 addition & 1 deletion readthedocs/gold/tests/test_forms.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
import django_dynamic_fixture as fixture
import mock
from unittest import mock
from django.contrib.auth.models import User
from django.test import TestCase

Expand Down
2 changes: 1 addition & 1 deletion readthedocs/gold/tests/test_signals.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
import django_dynamic_fixture as fixture
import mock
from unittest import mock
from django.contrib.auth.models import User
from django.test import TestCase

Expand Down
2 changes: 1 addition & 1 deletion readthedocs/proxito/tests/test_full.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import os

import django_dynamic_fixture as fixture
import mock
from unittest import mock
from django.conf import settings
from django.http import HttpResponse
from django.test.utils import override_settings
Expand Down
2 changes: 1 addition & 1 deletion readthedocs/rtd_tests/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from django.contrib.messages.storage.fallback import FallbackStorage
from django.contrib.sessions.middleware import SessionMiddleware
from django.test import RequestFactory, TestCase
from mock import patch
from unittest.mock import patch


log = logging.getLogger(__name__)
Expand Down
2 changes: 1 addition & 1 deletion readthedocs/rtd_tests/mocks/environment.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
# pylint: disable=missing-docstring
import mock
from unittest import mock


class EnvironmentMockGroup:
Expand Down
2 changes: 1 addition & 1 deletion readthedocs/rtd_tests/mocks/mock_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import json
from contextlib import contextmanager

import mock
from unittest import mock


# Mock tastypi API.
Expand Down
2 changes: 1 addition & 1 deletion readthedocs/rtd_tests/mocks/paths.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import os
import re

import mock
from unittest import mock


def fake_paths(check):
Expand Down
2 changes: 1 addition & 1 deletion readthedocs/rtd_tests/tests/projects/test_admin_actions.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
import django_dynamic_fixture as fixture
import mock
from unittest import mock
from django import urls
from django.contrib.admin.helpers import ACTION_CHECKBOX_NAME
from django.contrib.auth.models import User
Expand Down
2 changes: 1 addition & 1 deletion readthedocs/rtd_tests/tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import datetime
import json

import mock
from unittest import mock
from allauth.socialaccount.models import SocialAccount
from django.contrib.auth.models import User
from django.http import QueryDict
Expand Down
2 changes: 1 addition & 1 deletion readthedocs/rtd_tests/tests/test_api_permissions.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from functools import partial
from unittest import TestCase

from mock import Mock
from unittest.mock import Mock

from readthedocs.api.v2.permissions import APIRestrictedPermission

Expand Down
2 changes: 1 addition & 1 deletion readthedocs/rtd_tests/tests/test_automation_rules.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import mock
from unittest import mock
import pytest
from django_dynamic_fixture import get

Expand Down
2 changes: 1 addition & 1 deletion readthedocs/rtd_tests/tests/test_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import django_dynamic_fixture as fixture
from django.contrib.auth.models import User
from mock import Mock, patch
from unittest.mock import Mock, patch

from readthedocs.builds.constants import EXTERNAL
from readthedocs.builds.models import Version
Expand Down
2 changes: 1 addition & 1 deletion readthedocs/rtd_tests/tests/test_build_forms.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import mock
from unittest import mock
from django.contrib.auth.models import User
from django.test import TestCase
from django.urls import reverse
Expand Down
2 changes: 1 addition & 1 deletion readthedocs/rtd_tests/tests/test_build_notifications.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import django_dynamic_fixture as fixture
from django.core import mail
from django.test import TestCase
from mock import patch
from unittest.mock import patch

from readthedocs.builds.models import Build, Version
from readthedocs.projects.forms import WebHookForm
Expand Down
2 changes: 1 addition & 1 deletion readthedocs/rtd_tests/tests/test_builds.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import datetime
import os

import mock
from unittest import mock
from django.contrib.auth.models import User
from django.test import TestCase
from django_dynamic_fixture import fixture, get
Expand Down
2 changes: 1 addition & 1 deletion readthedocs/rtd_tests/tests/test_celery.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from django.contrib.auth.models import User
from django_dynamic_fixture import get
from messages_extends.models import Message
from mock import MagicMock, patch
from unittest.mock import MagicMock, patch

from readthedocs.builds.constants import (
BUILD_STATE_TRIGGERED,
Expand Down
4 changes: 2 additions & 2 deletions readthedocs/rtd_tests/tests/test_config_integration.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import tempfile
from os import path

import mock
from unittest import mock
import pytest
import yaml
from django.test import TestCase
from django_dynamic_fixture import get
from mock import MagicMock, PropertyMock, patch
from unittest.mock import MagicMock, PropertyMock, patch

from readthedocs.builds.constants import BUILD_STATE_TRIGGERED, EXTERNAL
from readthedocs.builds.models import Version
Expand Down
2 changes: 1 addition & 1 deletion readthedocs/rtd_tests/tests/test_core_tags.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import mock
from unittest import mock
import pytest
from django.conf import settings
from django.test import TestCase
Expand Down
4 changes: 2 additions & 2 deletions readthedocs/rtd_tests/tests/test_core_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

import os

import mock
from unittest import mock
from django.http import Http404
from django.test import TestCase
from django_dynamic_fixture import get
from mock import call
from unittest.mock import call

from readthedocs.builds.constants import LATEST
from readthedocs.builds.models import Version
Expand Down
4 changes: 2 additions & 2 deletions readthedocs/rtd_tests/tests/test_doc_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
import tempfile
from collections import namedtuple

import mock
from unittest import mock
import py
import pytest
import yaml
from django.test import TestCase
from django.test.utils import override_settings
from django_dynamic_fixture import get
from mock import patch
from unittest.mock import patch

from readthedocs.builds.models import Version
from readthedocs.doc_builder.backends.mkdocs import MkdocsHTML
Expand Down
4 changes: 2 additions & 2 deletions readthedocs/rtd_tests/tests/test_doc_building.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@
import tempfile
import uuid

import mock
from unittest import mock
import pytest
from django.test import TestCase
from django_dynamic_fixture import get
from docker.errors import APIError as DockerAPIError
from docker.errors import DockerException
from mock import Mock, PropertyMock, mock_open, patch
from unittest.mock import Mock, PropertyMock, mock_open, patch

from readthedocs.builds.constants import BUILD_STATE_CLONING
from readthedocs.builds.models import Version
Expand Down
4 changes: 2 additions & 2 deletions readthedocs/rtd_tests/tests/test_doc_serving.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import os

import django_dynamic_fixture as fixture
import mock
from unittest import mock
from django.conf import settings
from django.contrib.auth.models import User
from django.http import Http404, HttpResponse
from django.test import RequestFactory, TestCase
from django.test.utils import override_settings
from django.urls import reverse
from mock import mock_open, patch
from unittest.mock import mock_open, patch

from readthedocs.builds.constants import LATEST, EXTERNAL, INTERNAL
from readthedocs.builds.models import Version
Expand Down
2 changes: 1 addition & 1 deletion readthedocs/rtd_tests/tests/test_footer.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import mock
from unittest import mock
from django.contrib.sessions.backends.base import SessionBase
from django.test import TestCase
from django.test.utils import override_settings
Expand Down
2 changes: 1 addition & 1 deletion readthedocs/rtd_tests/tests/test_imported_file.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-

import os
import mock
from unittest import mock

from django.conf import settings
from django.core.files.storage import get_storage_class
Expand Down
2 changes: 1 addition & 1 deletion readthedocs/rtd_tests/tests/test_notifications.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@


import django_dynamic_fixture as fixture
import mock
from unittest import mock
from django.contrib.auth.models import AnonymousUser, User
from django.http import HttpRequest
from django.test import TestCase
Expand Down
2 changes: 1 addition & 1 deletion readthedocs/rtd_tests/tests/test_oauth.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
import mock
from unittest import mock
from django.conf import settings
from django.contrib.auth.models import User
from django.test import TestCase
Expand Down
2 changes: 1 addition & 1 deletion readthedocs/rtd_tests/tests/test_oauth_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from django.contrib.auth.models import User
from django.test import TestCase
from django_dynamic_fixture import get
from mock import patch
from unittest.mock import patch

from readthedocs.builds.models import Version
from readthedocs.oauth.services.base import SyncServiceError
Expand Down
2 changes: 1 addition & 1 deletion readthedocs/rtd_tests/tests/test_privacy.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import logging

import mock
from unittest import mock
from django.contrib.auth.models import User
from django.test import TestCase
from django.test.utils import override_settings
Expand Down
2 changes: 1 addition & 1 deletion readthedocs/rtd_tests/tests/test_privacy_urls.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import re

import mock
from unittest import mock
from allauth.socialaccount.models import SocialAccount
from django.contrib.admindocs.views import extract_views_from_urlpatterns
from django.test import TestCase
Expand Down
2 changes: 1 addition & 1 deletion readthedocs/rtd_tests/tests/test_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from django.test import TestCase
from django.utils import timezone
from django_dynamic_fixture import get
from mock import patch
from unittest.mock import patch
from rest_framework.reverse import reverse

from readthedocs.builds.constants import (
Expand Down
2 changes: 1 addition & 1 deletion readthedocs/rtd_tests/tests/test_project_forms.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import mock
from unittest import mock
from django.contrib.auth.models import User
from django.test import TestCase
from django.test.utils import override_settings
Expand Down
2 changes: 1 addition & 1 deletion readthedocs/rtd_tests/tests/test_project_symlinks.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import shutil
import tempfile

import mock
from unittest import mock
from django.conf import settings
from django.test import TestCase, override_settings
from django.urls import reverse
Expand Down
2 changes: 1 addition & 1 deletion readthedocs/rtd_tests/tests/test_project_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from django.utils import timezone
from django.views.generic.base import ContextMixin
from django_dynamic_fixture import get, new
from mock import patch
from unittest.mock import patch

from readthedocs.builds.constants import EXTERNAL, LATEST
from readthedocs.builds.models import Build, Version
Expand Down
2 changes: 1 addition & 1 deletion readthedocs/rtd_tests/tests/test_projects_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from django.test import TestCase
from django_dynamic_fixture import get
from mock import patch
from unittest.mock import patch

from readthedocs.builds.constants import EXTERNAL, BUILD_STATUS_SUCCESS
from readthedocs.builds.models import Version, Build
Expand Down
2 changes: 1 addition & 1 deletion readthedocs/rtd_tests/tests/test_resolver.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import django_dynamic_fixture as fixture
import mock
from unittest import mock
from django.test import TestCase, override_settings

from readthedocs.core.resolver import (
Expand Down
2 changes: 1 addition & 1 deletion readthedocs/rtd_tests/tests/test_subprojects.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
import django_dynamic_fixture as fixture
import mock
from unittest import mock
from django.contrib.auth.models import User
from django.test import TestCase
from django.test.utils import override_settings
Expand Down
2 changes: 1 addition & 1 deletion readthedocs/rtd_tests/tests/test_sync_versions.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-

import json
import mock
from unittest import mock

from django.test import TestCase
from django.urls import reverse
Expand Down
2 changes: 1 addition & 1 deletion readthedocs/rtd_tests/tests/test_views.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import csv
from urllib.parse import urlsplit

import mock
from unittest import mock
from django.contrib.auth.models import User
from django.test import TestCase
from django.urls import reverse
Expand Down
4 changes: 2 additions & 2 deletions readthedocs/rtd_tests/tests/versions/test_admin_actions.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# -*- coding: utf-8 -*-

import os
import mock
from unittest import mock

from mock import call
from unittest.mock import call
import django_dynamic_fixture as fixture
from django.test import TestCase
from django.contrib.admin.helpers import ACTION_CHECKBOX_NAME
Expand Down
2 changes: 1 addition & 1 deletion readthedocs/search/tests/test_search_tasks.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""Tests for search tasks."""

import mock
from unittest import mock
import pytest

from django.urls import reverse
Expand Down
Loading