From d5793e04ec0ea5bb2690505804b9c9fe7fe74acd Mon Sep 17 00:00:00 2001 From: ShaharNaveh <50263213+ShaharNaveh@users.noreply.github.com> Date: Sat, 26 Jul 2025 17:48:07 +0200 Subject: [PATCH] Don't import `unittest.mock` in `test_int.py` --- Lib/test/test_int.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Lib/test/test_int.py b/Lib/test/test_int.py index 0759cb97a..3ad421861 100644 --- a/Lib/test/test_int.py +++ b/Lib/test/test_int.py @@ -2,7 +2,11 @@ import sys import time import unittest -from unittest import mock +# TODO: RUSTPYTHON +# This is one of the tests that we run on wasi. `unittest.mock` requires `_socket` +# which we don't have on wasi (yet). Also, every test here the needs `unittest.mock` +# is cpython specifc, so this import is redundent anyway. +# from unittest import mock from test import support from test.support.numbers import ( VALID_UNDERSCORE_LITERALS, @@ -889,7 +893,7 @@ class PyLongModuleTests(unittest.TestCase): @support.cpython_only # tests implementation details of CPython. @unittest.skipUnless(_pylong, "_pylong module required") - @mock.patch.object(_pylong, "int_to_decimal_string") + # @mock.patch.object(_pylong, "int_to_decimal_string") # NOTE(RUSTPYTHON): See comment at top of file def test_pylong_misbehavior_error_path_to_str( self, mock_int_to_str): with support.adjust_int_max_str_digits(20_000): @@ -905,7 +909,7 @@ class PyLongModuleTests(unittest.TestCase): @support.cpython_only # tests implementation details of CPython. @unittest.skipUnless(_pylong, "_pylong module required") - @mock.patch.object(_pylong, "int_from_string") + # @mock.patch.object(_pylong, "int_from_string") # NOTE(RUSTPYTHON): See comment at top of file def test_pylong_misbehavior_error_path_from_str( self, mock_int_from_str): big_value = '7'*19_999