Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package python-s3transfer for
openSUSE:Factory checked in at 2026-05-12 19:26:50
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-s3transfer (Old)
and /work/SRC/openSUSE:Factory/.python-s3transfer.new.1966 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-s3transfer"
Tue May 12 19:26:50 2026 rev:43 rq:1352510 version:0.17.0
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-s3transfer/python-s3transfer.changes
2025-12-12 21:41:18.429162103 +0100
+++
/work/SRC/openSUSE:Factory/.python-s3transfer.new.1966/python-s3transfer.changes
2026-05-12 19:27:32.385254195 +0200
@@ -1,0 +2,10 @@
+Mon May 11 10:53:36 UTC 2026 - John Paul Adrian Glaubitz
<[email protected]>
+
+- Update to version 0.17.0
+ * feature:Python: End of support for Python 3.9
+- from version 0.16.1
+ * enhancement:``TransferManager``: Add support for customer-provided
+ full-object checksums using the SHA512, MD5, XXHASH3, XXHASH64,
+ and XXHASH128 algorithms.
+
+-------------------------------------------------------------------
Old:
----
s3transfer-0.16.0.tar.gz
New:
----
s3transfer-0.17.0.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-s3transfer.spec ++++++
--- /var/tmp/diff_new_pack.j8yj61/_old 2026-05-12 19:27:33.353294315 +0200
+++ /var/tmp/diff_new_pack.j8yj61/_new 2026-05-12 19:27:33.357294481 +0200
@@ -1,7 +1,7 @@
#
# spec file for package python-s3transfer
#
-# Copyright (c) 2025 SUSE LLC
+# Copyright (c) 2026 SUSE LLC and contributors
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -18,7 +18,7 @@
%{?sle15_python_module_pythons}
Name: python-s3transfer
-Version: 0.16.0
+Version: 0.17.0
Release: 0
Summary: Python S3 transfer manager
License: Apache-2.0
++++++ s3transfer-0.16.0.tar.gz -> s3transfer-0.17.0.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/s3transfer-0.16.0/PKG-INFO
new/s3transfer-0.17.0/PKG-INFO
--- old/s3transfer-0.16.0/PKG-INFO 2025-12-01 02:09:28.138971600 +0100
+++ new/s3transfer-0.17.0/PKG-INFO 2026-04-29 21:50:38.034865400 +0200
@@ -1,6 +1,6 @@
Metadata-Version: 2.1
Name: s3transfer
-Version: 0.16.0
+Version: 0.17.0
Summary: An Amazon S3 Transfer Manager
Home-page: https://github.com/boto/s3transfer
Author: Amazon Web Services
@@ -13,13 +13,12 @@
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
-Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
-Requires-Python: >= 3.9
+Requires-Python: >= 3.10
License-File: LICENSE.txt
License-File: NOTICE.txt
Requires-Dist: botocore<2.0a.0,>=1.37.4
@@ -38,4 +37,4 @@
This project is not currently GA. If you are planning to use this code in
production, make sure to lock to a minor version as interfaces may break
from minor version to minor version. For a basic, stable interface of
- s3transfer, try the interfaces exposed in `boto3
<https://boto3.readthedocs.io/en/latest/guide/s3.html#using-the-transfer-manager>`__
+ s3transfer, try the interfaces exposed in `boto3
<https://docs.aws.amazon.com/boto3/latest/guide/s3.html>`__
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/s3transfer-0.16.0/README.rst
new/s3transfer-0.17.0/README.rst
--- old/s3transfer-0.16.0/README.rst 2025-12-01 02:05:18.000000000 +0100
+++ new/s3transfer-0.17.0/README.rst 2026-04-29 21:46:46.000000000 +0200
@@ -10,4 +10,4 @@
This project is not currently GA. If you are planning to use this code in
production, make sure to lock to a minor version as interfaces may break
from minor version to minor version. For a basic, stable interface of
- s3transfer, try the interfaces exposed in `boto3
<https://boto3.readthedocs.io/en/latest/guide/s3.html#using-the-transfer-manager>`__
+ s3transfer, try the interfaces exposed in `boto3
<https://docs.aws.amazon.com/boto3/latest/guide/s3.html>`__
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/s3transfer-0.16.0/pyproject.toml
new/s3transfer-0.17.0/pyproject.toml
--- old/s3transfer-0.16.0/pyproject.toml 2025-12-01 02:05:18.000000000
+0100
+++ new/s3transfer-0.17.0/pyproject.toml 2026-04-29 21:50:37.000000000
+0200
@@ -37,7 +37,7 @@
line-length = 79
indent-width = 4
-target-version = "py39"
+target-version = "py310"
[tool.ruff.lint]
# Enable Pyflakes (`F`) and a subset of the pycodestyle (`E`) codes by
default.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/s3transfer-0.16.0/s3transfer/__init__.py
new/s3transfer-0.17.0/s3transfer/__init__.py
--- old/s3transfer-0.16.0/s3transfer/__init__.py 2025-12-01
02:09:27.000000000 +0100
+++ new/s3transfer-0.17.0/s3transfer/__init__.py 2026-04-29
21:50:37.000000000 +0200
@@ -131,7 +131,6 @@
import os
import queue
import random
-import socket
import string
import threading
from logging import NullHandler
@@ -146,7 +145,7 @@
from s3transfer.exceptions import RetriesExceededError, S3UploadFailedError
__author__ = 'Amazon Web Services'
-__version__ = '0.16.0'
+__version__ = '0.17.0'
logger = logging.getLogger(__name__)
@@ -617,7 +616,7 @@
current_index += len(chunk)
return
except (
- socket.timeout,
+ TimeoutError,
OSError,
ReadTimeoutError,
IncompleteReadError,
@@ -843,7 +842,7 @@
bucket, key, filename, extra_args, callback
)
except (
- socket.timeout,
+ TimeoutError,
OSError,
ReadTimeoutError,
IncompleteReadError,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/s3transfer-0.16.0/s3transfer/constants.py
new/s3transfer-0.17.0/s3transfer/constants.py
--- old/s3transfer-0.16.0/s3transfer/constants.py 2025-12-01
02:05:18.000000000 +0100
+++ new/s3transfer-0.17.0/s3transfer/constants.py 2026-04-29
21:46:46.000000000 +0200
@@ -30,8 +30,13 @@
'ChecksumCRC32',
'ChecksumCRC32C',
'ChecksumCRC64NVME',
+ 'ChecksumMD5',
'ChecksumSHA1',
'ChecksumSHA256',
+ 'ChecksumSHA512',
+ 'ChecksumXXHASH3',
+ 'ChecksumXXHASH64',
+ 'ChecksumXXHASH128',
]
USER_AGENT = f's3transfer/{s3transfer.__version__}'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/s3transfer-0.16.0/s3transfer/processpool.py
new/s3transfer-0.17.0/s3transfer/processpool.py
--- old/s3transfer-0.16.0/s3transfer/processpool.py 2025-12-01
02:05:18.000000000 +0100
+++ new/s3transfer-0.17.0/s3transfer/processpool.py 2026-04-29
21:46:46.000000000 +0200
@@ -73,7 +73,7 @@
* ``extra_args``: A dictionary containing any additional client arguments
to include in the
- `GetObject
<https://botocore.amazonaws.com/v1/documentation/api/latest/reference/services/s3.html#S3.Client.get_object>`_
+ `GetObject
<https://docs.aws.amazon.com/botocore/latest/reference/services/s3/client/get_object.html>`_
API request. For example:
.. code:: python
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/s3transfer-0.16.0/s3transfer.egg-info/PKG-INFO
new/s3transfer-0.17.0/s3transfer.egg-info/PKG-INFO
--- old/s3transfer-0.16.0/s3transfer.egg-info/PKG-INFO 2025-12-01
02:09:28.000000000 +0100
+++ new/s3transfer-0.17.0/s3transfer.egg-info/PKG-INFO 2026-04-29
21:50:37.000000000 +0200
@@ -1,6 +1,6 @@
Metadata-Version: 2.1
Name: s3transfer
-Version: 0.16.0
+Version: 0.17.0
Summary: An Amazon S3 Transfer Manager
Home-page: https://github.com/boto/s3transfer
Author: Amazon Web Services
@@ -13,13 +13,12 @@
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
-Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
-Requires-Python: >= 3.9
+Requires-Python: >= 3.10
License-File: LICENSE.txt
License-File: NOTICE.txt
Requires-Dist: botocore<2.0a.0,>=1.37.4
@@ -38,4 +37,4 @@
This project is not currently GA. If you are planning to use this code in
production, make sure to lock to a minor version as interfaces may break
from minor version to minor version. For a basic, stable interface of
- s3transfer, try the interfaces exposed in `boto3
<https://boto3.readthedocs.io/en/latest/guide/s3.html#using-the-transfer-manager>`__
+ s3transfer, try the interfaces exposed in `boto3
<https://docs.aws.amazon.com/boto3/latest/guide/s3.html>`__
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/s3transfer-0.16.0/s3transfer.egg-info/SOURCES.txt
new/s3transfer-0.17.0/s3transfer.egg-info/SOURCES.txt
--- old/s3transfer-0.16.0/s3transfer.egg-info/SOURCES.txt 2025-12-01
02:09:28.000000000 +0100
+++ new/s3transfer-0.17.0/s3transfer.egg-info/SOURCES.txt 2026-04-29
21:50:38.000000000 +0200
@@ -46,9 +46,11 @@
tests/integration/test_upload.py
tests/unit/__init__.py
tests/unit/test_bandwidth.py
+tests/unit/test_changelog.py
tests/unit/test_compat.py
tests/unit/test_copies.py
tests/unit/test_crt.py
+tests/unit/test_decorators.py
tests/unit/test_delete.py
tests/unit/test_download.py
tests/unit/test_futures.py
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/s3transfer-0.16.0/setup.py
new/s3transfer-0.17.0/setup.py
--- old/s3transfer-0.16.0/setup.py 2025-12-01 02:05:18.000000000 +0100
+++ new/s3transfer-0.17.0/setup.py 2026-04-29 21:50:37.000000000 +0200
@@ -33,7 +33,7 @@
'crt': 'botocore[crt]>=1.37.4,<2.0a.0',
},
license="Apache License 2.0",
- python_requires=">= 3.9",
+ python_requires=">= 3.10",
classifiers=[
'Development Status :: 3 - Alpha',
'Intended Audience :: Developers',
@@ -42,7 +42,6 @@
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3 :: Only',
- 'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/s3transfer-0.16.0/tests/__init__.py
new/s3transfer-0.17.0/tests/__init__.py
--- old/s3transfer-0.16.0/tests/__init__.py 2025-12-01 02:05:18.000000000
+0100
+++ new/s3transfer-0.17.0/tests/__init__.py 2026-04-29 21:46:46.000000000
+0200
@@ -100,6 +100,11 @@
self.assertEqual(...)
"""
+ if callable(reason):
+ raise TypeError(
+ "Use @skip_if_windows('reason') with parentheses, "
+ "not bare @skip_if_windows"
+ )
def decorator(func):
return unittest.skipIf(
@@ -111,6 +116,11 @@
def skip_if_using_serial_implementation(reason):
"""Decorator to skip tests when running as the serial implementation"""
+ if callable(reason):
+ raise TypeError(
+ "Use @skip_if_using_serial_implementation('reason') with
parentheses, "
+ "not bare @skip_if_using_serial_implementation"
+ )
def decorator(func):
return unittest.skipIf(is_serial_implementation(), reason)(func)
@@ -118,10 +128,18 @@
return decorator
-def requires_crt(cls, reason=None):
+def requires_crt(reason=None):
+ if callable(reason):
+ raise TypeError(
+ "Use @requires_crt() with parentheses, not bare @requires_crt"
+ )
if reason is None:
reason = "Test requires awscrt to be installed."
- return unittest.skipIf(not HAS_CRT, reason)(cls)
+
+ def decorator(func):
+ return unittest.skipIf(not HAS_CRT, reason)(func)
+
+ return decorator
class StreamWithError:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/s3transfer-0.16.0/tests/functional/test_crt.py
new/s3transfer-0.17.0/tests/functional/test_crt.py
--- old/s3transfer-0.16.0/tests/functional/test_crt.py 2025-12-01
02:09:27.000000000 +0100
+++ new/s3transfer-0.17.0/tests/functional/test_crt.py 2026-04-29
21:46:46.000000000 +0200
@@ -65,7 +65,7 @@
self.on_done_future = future
-@requires_crt
+@requires_crt()
class TestCRTTransferManager(unittest.TestCase):
def setUp(self):
self.region = 'us-west-2'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/s3transfer-0.16.0/tests/integration/__init__.py
new/s3transfer-0.17.0/tests/integration/__init__.py
--- old/s3transfer-0.16.0/tests/integration/__init__.py 2025-12-01
02:05:18.000000000 +0100
+++ new/s3transfer-0.17.0/tests/integration/__init__.py 2026-04-29
21:46:46.000000000 +0200
@@ -61,6 +61,21 @@
CreateBucketConfiguration={'LocationConstraint': cls.region},
ObjectOwnership='ObjectWriter',
)
+ cls.client.put_bucket_encryption(
+ Bucket=cls.bucket_name,
+ ServerSideEncryptionConfiguration={
+ 'Rules': [
+ {
+ 'ApplyServerSideEncryptionByDefault': {
+ 'SSEAlgorithm': 'AES256',
+ },
+ 'BlockedEncryptionTypes': {
+ 'EncryptionType': ['NONE'],
+ },
+ }
+ ],
+ },
+ )
cls.client.delete_public_access_block(Bucket=cls.bucket_name)
def setUp(self):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/s3transfer-0.16.0/tests/integration/test_crt.py
new/s3transfer-0.17.0/tests/integration/test_crt.py
--- old/s3transfer-0.16.0/tests/integration/test_crt.py 2025-12-01
02:05:18.000000000 +0100
+++ new/s3transfer-0.17.0/tests/integration/test_crt.py 2026-04-29
21:46:46.000000000 +0200
@@ -50,7 +50,7 @@
self.on_done_called = True
-@requires_crt
+@requires_crt()
class TestCRTS3Transfers(BaseTransferManagerIntegTest):
"""Tests for the high level s3transfer based on CRT implementation."""
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/s3transfer-0.16.0/tests/unit/test_changelog.py
new/s3transfer-0.17.0/tests/unit/test_changelog.py
--- old/s3transfer-0.16.0/tests/unit/test_changelog.py 1970-01-01
01:00:00.000000000 +0100
+++ new/s3transfer-0.17.0/tests/unit/test_changelog.py 2026-04-29
21:50:37.000000000 +0200
@@ -0,0 +1,43 @@
+# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
+# SPDX-License-Identifier: Apache-2.0
+import json
+from pathlib import Path
+
+import pytest
+
+REPO_ROOT = Path(__file__).parents[2]
+NEXT_RELEASE_DIR = REPO_ROOT / '.changes' / 'next-release'
+
+
+def _next_release_json_files():
+ if not NEXT_RELEASE_DIR.is_dir():
+ return []
+ return [
+ p for p in sorted(NEXT_RELEASE_DIR.iterdir()) if p.suffix == '.json'
+ ]
+
+
[email protected](
+ "json_path",
+ _next_release_json_files(),
+ ids=lambda p: p.name,
+)
+def test_next_release_json_is_well_formed(json_path):
+ raw = json_path.read_text('utf-8')
+ try:
+ entry = json.loads(raw)
+ except json.JSONDecodeError as e:
+ pytest.fail(f"{json_path.name} is not valid JSON: {e}")
+ assert isinstance(entry, dict), (
+ f"{json_path.name} should be a JSON object, got {type(entry).__name__}"
+ )
+ VALID_TYPES = {'feature', 'bugfix', 'enhancement', 'api-change'}
+ for key in ('category', 'description', 'type'):
+ assert key in entry, f"{json_path.name} missing required key '{key}'"
+ assert isinstance(entry[key], str) and entry[key].strip(), (
+ f"{json_path.name} key '{key}' must be a non-empty string"
+ )
+ assert entry['type'] in VALID_TYPES, (
+ f"{json_path.name} has invalid type '{entry['type']}', "
+ f"must be one of {sorted(VALID_TYPES)}"
+ )
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/s3transfer-0.16.0/tests/unit/test_compat.py
new/s3transfer-0.17.0/tests/unit/test_compat.py
--- old/s3transfer-0.16.0/tests/unit/test_compat.py 2025-12-01
02:05:18.000000000 +0100
+++ new/s3transfer-0.17.0/tests/unit/test_compat.py 2026-04-29
21:46:46.000000000 +0200
@@ -14,6 +14,7 @@
import os
import shutil
import signal
+import socket
import tempfile
from io import BytesIO
@@ -79,13 +80,28 @@
class TestBaseManager(unittest.TestCase):
+ def _can_bind_socket(self):
+ sock = socket.socket()
+ try:
+ sock.bind(('127.0.0.1', 0))
+ return True
+ except PermissionError:
+ return False
+ finally:
+ sock.close()
+
def create_pid_manager(self):
class PIDManager(BaseManager):
def __init__(self):
# Python 3.14 changed the non-macOS POSIX default to forkserver
- # but the code in this module does not work with it
+ # and macOS defaults to spawn. This test uses a local manager
+ # class which is not picklable under spawn/forkserver, so force
+ # fork for the test.
# See https://github.com/python/cpython/issues/125714
- if multiprocessing.get_start_method() == 'forkserver':
+ if multiprocessing.get_start_method() in (
+ 'forkserver',
+ 'spawn',
+ ):
ctx = multiprocessing.get_context(method='fork')
else:
ctx = multiprocessing.get_context()
@@ -102,6 +118,8 @@
@skip_if_windows('os.kill() with SIGINT not supported on Windows')
def test_can_provide_signal_handler_initializers_to_start(self):
+ if not self._can_bind_socket():
+ self.skipTest('socket bind is not permitted in this environment')
manager = self.create_pid_manager()
manager.start(signal.signal, (signal.SIGINT, signal.SIG_IGN))
pid = self.get_pid(manager)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/s3transfer-0.16.0/tests/unit/test_crt.py
new/s3transfer-0.17.0/tests/unit/test_crt.py
--- old/s3transfer-0.16.0/tests/unit/test_crt.py 2025-12-01
02:05:18.000000000 +0100
+++ new/s3transfer-0.17.0/tests/unit/test_crt.py 2026-04-29
21:46:46.000000000 +0200
@@ -89,7 +89,7 @@
mock_crt_process_lock.return_value.acquire.assert_called_once_with()
-@requires_crt
+@requires_crt()
class TestBotocoreCRTRequestSerializer(unittest.TestCase):
def setUp(self):
self.region = 'us-west-2'
@@ -291,7 +291,7 @@
self.assert_crt_credentials(crt_credentials)
-@requires_crt
+@requires_crt()
class TestCRTTransferFuture(unittest.TestCase):
def setUp(self):
self.mock_s3_request = mock.Mock(awscrt.s3.S3RequestType)
@@ -320,7 +320,7 @@
self.future.result()
-@requires_crt
+@requires_crt()
class TestOnBodyFileObjWriter(unittest.TestCase):
def test_call(self):
fileobj = io.BytesIO()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/s3transfer-0.16.0/tests/unit/test_decorators.py
new/s3transfer-0.17.0/tests/unit/test_decorators.py
--- old/s3transfer-0.16.0/tests/unit/test_decorators.py 1970-01-01
01:00:00.000000000 +0100
+++ new/s3transfer-0.17.0/tests/unit/test_decorators.py 2026-04-29
21:46:46.000000000 +0200
@@ -0,0 +1,109 @@
+# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License").
+# You may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+from unittest import mock
+
+import pytest
+
+from tests import (
+ requires_crt,
+ skip_if_using_serial_implementation,
+ skip_if_windows,
+)
+
+
+class TestSkipIfWindows:
+ def test_bare_skip_if_windows_fails_immediately(self):
+ with pytest.raises(TypeError):
+
+ @skip_if_windows
+ def my_test():
+ pass
+
+ def test_skip_if_windows_skips_on_windows(self):
+ with mock.patch('tests.platform') as mock_platform:
+ mock_platform.system.return_value = 'Windows'
+
+ @skip_if_windows('Not supported on Windows')
+ def my_test():
+ assert False
+
+ assert getattr(my_test, '__unittest_skip__', False) is True
+
+ def test_skip_if_windows_runs_on_non_windows(self):
+ with mock.patch('tests.platform') as mock_platform:
+ mock_platform.system.return_value = 'Linux'
+
+ @skip_if_windows('Not supported on Windows')
+ def my_test():
+ pass
+
+ assert getattr(my_test, '__unittest_skip__', False) is False
+
+
+class TestSkipIfUsingSerialImplementation:
+ def test_bare_skip_if_using_serial_implementation_fails_immediately(self):
+ with pytest.raises(TypeError):
+
+ @skip_if_using_serial_implementation
+ def my_test():
+ pass
+
+ def test_skip_if_using_serial_implementation_skips_when_serial(self):
+ with mock.patch('tests.is_serial_implementation', return_value=True):
+
+ @skip_if_using_serial_implementation(
+ 'Not supported in serial mode'
+ )
+ def my_test():
+ assert False
+
+ assert getattr(my_test, '__unittest_skip__', False) is True
+
+ def test_skip_if_using_serial_implementation_runs_when_not_serial(self):
+ with mock.patch('tests.is_serial_implementation', return_value=False):
+
+ @skip_if_using_serial_implementation(
+ 'Not supported in serial mode'
+ )
+ def my_test():
+ pass
+
+ assert getattr(my_test, '__unittest_skip__', False) is False
+
+
+class TestRequiresCrt:
+ def test_bare_requires_crt_fails_immediately(self):
+ with pytest.raises(TypeError):
+
+ @requires_crt
+ def my_test():
+ pass
+
+ def test_requires_crt_skips_when_no_crt(self):
+ with mock.patch('tests.HAS_CRT', False):
+
+ @requires_crt()
+ def my_test():
+ assert False
+
+ assert getattr(my_test, '__unittest_skip__', False) is True
+
+ def test_requires_crt_runs_when_crt_available(self):
+ with mock.patch('tests.HAS_CRT', True):
+
+ @requires_crt()
+ def my_test():
+ pass
+
+ assert getattr(my_test, '__unittest_skip__', False) is False