1
0

- add mock.patch to use mock from stdlib

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-sentry-sdk?expand=0&rev=49
This commit is contained in:
Dirk Mueller 2023-05-29 13:31:53 +00:00 committed by Git OBS Bridge
parent ace847fdba
commit 852b673dcf
3 changed files with 70 additions and 2 deletions

63
mock.patch Normal file
View File

@ -0,0 +1,63 @@
Index: sentry-python-1.24.0/tests/tracing/test_decorator_py3.py
===================================================================
--- sentry-python-1.24.0.orig/tests/tracing/test_decorator_py3.py
+++ sentry-python-1.24.0/tests/tracing/test_decorator_py3.py
@@ -1,4 +1,4 @@
-import mock
+from unittest import mock
import pytest
import sys
Index: sentry-python-1.24.0/tests/tracing/test_misc.py
===================================================================
--- sentry-python-1.24.0.orig/tests/tracing/test_misc.py
+++ sentry-python-1.24.0/tests/tracing/test_misc.py
@@ -1,4 +1,4 @@
-from mock import MagicMock
+from unittest.mock import MagicMock
import pytest
import gc
import uuid
Index: sentry-python-1.24.0/tests/test_api.py
===================================================================
--- sentry-python-1.24.0.orig/tests/test_api.py
+++ sentry-python-1.24.0/tests/test_api.py
@@ -1,4 +1,4 @@
-import mock
+from unittest import mock
from sentry_sdk import (
configure_scope,
Index: sentry-python-1.24.0/tests/test_client.py
===================================================================
--- sentry-python-1.24.0.orig/tests/test_client.py
+++ sentry-python-1.24.0/tests/test_client.py
@@ -1,7 +1,7 @@
# coding: utf-8
import os
import json
-import mock
+from unittest import mock
import pytest
import subprocess
import sys
Index: sentry-python-1.24.0/tests/test_crons.py
===================================================================
--- sentry-python-1.24.0.orig/tests/test_crons.py
+++ sentry-python-1.24.0/tests/test_crons.py
@@ -1,4 +1,4 @@
-import mock
+from unittest import mock
import pytest
import uuid
Index: sentry-python-1.24.0/tests/tracing/test_decorator_py2.py
===================================================================
--- sentry-python-1.24.0.orig/tests/tracing/test_decorator_py2.py
+++ sentry-python-1.24.0/tests/tracing/test_decorator_py2.py
@@ -1,4 +1,4 @@
-import mock
+from unittest import mock
from sentry_sdk.tracing_utils_py2 import (
start_child_span_decorator as start_child_span_decorator_py2,

View File

@ -1,3 +1,8 @@
-------------------------------------------------------------------
Mon May 29 13:31:22 UTC 2023 - Dirk Müller <dmueller@suse.com>
- add mock.patch to use mock from stdlib
-------------------------------------------------------------------
Tue May 23 10:39:34 UTC 2023 - ecsos <ecsos@opensuse.org>

View File

@ -28,6 +28,7 @@ License: BSD-2-Clause
Group: Development/Languages/Python
URL: https://github.com/getsentry/sentry-python
Source0: https://github.com/getsentry/sentry-python/archive/%{version}/sentry-python-%{version}.tar.gz
Patch1: mock.patch
BuildRequires: %{python_module Django >= 1.8}
BuildRequires: %{python_module Flask >= 0.11}
BuildRequires: %{python_module SQLAlchemy >= 1.2}
@ -55,7 +56,6 @@ BuildRequires: %{python_module eventlet}
BuildRequires: %{python_module gevent}
BuildRequires: %{python_module hypothesis}
BuildRequires: %{python_module jsonschema >= 3.2.0}
BuildRequires: %{python_module mock}
BuildRequires: %{python_module pyramid}
BuildRequires: %{python_module pyrsistent >= 0.16.0}
BuildRequires: %{python_module pytest-cov >= 2.8.1}
@ -115,7 +115,7 @@ A Python SDK for Sentry.io.
https://sentry.io/for/python/
%prep
%setup -q -n sentry-python-%{version}
%autosetup -p1 -n sentry-python-%{version}
%build
%python_build