14
0

Compare commits

...

31 Commits

Author SHA256 Message Date
e7d2aefea0 Accepting request 1204915 from devel:languages:python
- Make Django build-requirement conditional and disable by default for
  SUSE:SLFO:Main, bsc#1231124

OBS-URL: https://build.opensuse.org/request/show/1204915
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-testfixtures?expand=0&rev=29
2024-10-02 19:32:38 +00:00
ccd31abce4 - Make Django build-requirement conditional and disable by default for
SUSE:SLFO:Main, bsc#1231124

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-testfixtures?expand=0&rev=60
2024-10-01 11:13:51 +00:00
1d3c0756f9 Accepting request 1203766 from devel:languages:python
- Add patch support-python-313.patch:
  * Support Python 3.13 AttributeError message changes.

- update to 8.3.0:
  * :class:`ShouldRaise` now supports :class:`ExceptionGroup`.
  * Fixed bug where
    :func:`~testfixtures.comparison.compare_generator` did not
    respect strict=True.
  * Fixed bug in the type annotations for :class:`ShouldRaise`
    and :func:`~testfixtures.comparison.compare_exception`.
  * :class:`LogCapture` will now raise an exception if closed
    while still installed. This can be a source of particularly
    confusing bugs.

OBS-URL: https://build.opensuse.org/request/show/1203766
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-testfixtures?expand=0&rev=28
2024-09-29 16:09:04 +00:00
bda7ca83e5 - Add patch support-python-313.patch:
* Support Python 3.13 AttributeError message changes.

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-testfixtures?expand=0&rev=58
2024-09-26 04:57:18 +00:00
49dfad6286 - update to 8.3.0:
* :class:`ShouldRaise` now supports :class:`ExceptionGroup`.
  * Fixed bug where
    :func:`~testfixtures.comparison.compare_generator` did not
    respect strict=True.
  * Fixed bug in the type annotations for :class:`ShouldRaise`
    and :func:`~testfixtures.comparison.compare_exception`.
  * :class:`LogCapture` will now raise an exception if closed
    while still installed. This can be a source of particularly
    confusing bugs.

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-testfixtures?expand=0&rev=57
2024-06-30 08:18:17 +00:00
0175f63bf3 Accepting request 1172638 from devel:languages:python
- Update to 8.2.0:
  * The strict option is now correctly respected when comparing nested
    objects.
  * When comparing datetime.datetime or datetime.time instances, if the fold
    is the only thing that's different, it's now shown in the output.
  * A more detailed exception is now raised when resolving a replacement
    doesn't give what's expected.
  * Replacement of methods on instances is now prevented when strict=True.
  * An exception is now raised when mocking and the original is not in the
    __dict__ of its containing objects.
  * Fix bug where replacement of methods on subclasses failed when using
    Replacer.on_class.
  * Implement strict comparison as an option for datetime.datetime
    and datetime.time.
  * Retire zope.component helpers.
  * Support bytes in popen.MockPopen commands.
  * Allow TempDirectory instances to be traversed as pathlib.Path objects.
  * Use the system default encoding where possible in TempDirectory.
  * Add TempDirectory option to manage current working directory.
  * Allow string class attributes to be replaced with Replacer and friends.
  * Fix nasty bug meaning some Replacer.on_class and Replacer.in_module
    replacements weren't restored.
  * Allow an alternative separator to be used for traversal during replacement
    with Replacer and friends.
  * Officially support Python 3.12.
  * Drop support Python 3.6.
- Add multibuild to break a cycle.
- Drop patch path-comparsion-312.patch, included upstream.

OBS-URL: https://build.opensuse.org/request/show/1172638
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-testfixtures?expand=0&rev=27
2024-06-14 16:59:08 +00:00
97a3ec2ff8 Accepting request 1132550 from devel:languages:python
OBS-URL: https://build.opensuse.org/request/show/1132550
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-testfixtures?expand=0&rev=26
2023-12-12 18:31:42 +00:00
53d0b43e4c Accepting request 1129684 from devel:languages:python
- Update to 7.2.2:
  * Fix bug in support for :class:`os.PathLike` arguments to
    :class:`popen.MockPopen`.
  * Added missing support for :class:`os.PathLike` arguments to
    :class:`popen.MockPopen`.
  * Add ``order_matters`` parameter to :class:`ShouldWarn`.
  * Implement new IDE and static-analysis ways of :doc:`mocking <mocking>`
    including additional parameters to :meth:`~Replacer.replace` along with
    the :any:`replace_on_class`, :any:`replace_in_module` and
    :any:`replace_in_environ` context managers.
- Add patch path-comparsion-312.patch:
  * Compare paths string-wise, due to Python 3.12 changes.
- Switch to autosetup and pyproject macros.
- Remove now unneeded Python 3.6 special-casing.

OBS-URL: https://build.opensuse.org/request/show/1129684
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-testfixtures?expand=0&rev=25
2023-11-30 20:59:03 +00:00
53082cacbc Accepting request 1042863 from devel:languages:python
OBS-URL: https://build.opensuse.org/request/show/1042863
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-testfixtures?expand=0&rev=24
2022-12-15 18:24:02 +00:00
4411f9dade Accepting request 1035575 from devel:languages:python
- Update to 7.0.3 (3 Nov 2022)
  * Further bugfixes around self-referential datastructures and :func:`compare`.
- Update to 7.0.2 (1 Nov 2022)
  * Reinstate support for self-referential data structures in :func:`compare`. The new implementation provides more clarity about
    what's going on and also ignores more immutable data types.
- Update to 7.0.1 (1 Nov 2022)
  * Remove non-functional support for self-referential data structures in :func:`compare`. The functionality didn't work but did cause
    erroneous reported equality of values in dictionaries that were actually not equal.

OBS-URL: https://build.opensuse.org/request/show/1035575
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-testfixtures?expand=0&rev=23
2022-11-15 12:18:12 +00:00
18e593ac73 Accepting request 1008127 from devel:languages:python
- Remove testfixtures-sybil3-py310.patch, it's included in upstream now.
- Update to 7.0.0
  * Refresh documentation.
  * Add type annotations.
  * Drop support for Python 2. The minimum supported Python version is now 3.6.
  * Sybil 3 is now the minimum supported version if you use
    :class:`~.sybil.FileParser`.
  * Rename and refactor the date and time mocks, they are now :any:`mock_date`,
    :any:`mock_datetime` and :any:`mock_time`. :func:`test_date`,
    :func:`test_datetime` and :func:`test_time` are still present as aliases
    but are now deprecated.
  * Add :meth:`TempDirectory.as_string`, :meth:`TempDirectory.as_path` and
    :meth:`TempDirectory.as_local`. :meth:`TempDirectory.getpath` is now
    deprecated.
  * :class:`TempDirectory` can now be used to wrap existing directories.
  * Fixed a bug where :any:`OutputCapture.captured` returned bytes instead of a
    string with fd=True.
  * The deprecated strict option to :class:`Comparison` has been removed, use
    the partial option instead.
  * The deprecated :meth:`TempDirectory.check`, :meth:`TempDirectory.check_dir`
    and :meth:`TempDirectory.check_all` methods have been removed.
- 6.18.5 (1 Mar 2022)
  * Fix bug in detection of Mock backport.
- 6.18.4 (25 Feb 2022)
  * Ensure compatibility with Sybil 2 and Sybil 3 along with pytest 6 and
    pytest 7.

OBS-URL: https://build.opensuse.org/request/show/1008127
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-testfixtures?expand=0&rev=22
2022-10-10 16:44:02 +00:00
984ecfcbb3 Accepting request 942857 from devel:languages:python
OBS-URL: https://build.opensuse.org/request/show/942857
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-testfixtures?expand=0&rev=21
2021-12-29 20:10:39 +00:00
cf0a50bd39 Accepting request 942014 from devel:languages:python
OBS-URL: https://build.opensuse.org/request/show/942014
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-testfixtures?expand=0&rev=20
2021-12-23 16:53:26 +00:00
e183170140 Accepting request 924047 from devel:languages:python
OBS-URL: https://build.opensuse.org/request/show/924047
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-testfixtures?expand=0&rev=19
2021-10-20 18:23:17 +00:00
3c539dc19c Accepting request 891895 from devel:languages:python
- update to 6.17.1
  - Fix bug where bug where duplicated entries in an ordered but partial
    :class:`SequenceComparison` could result in a failed match.

OBS-URL: https://build.opensuse.org/request/show/891895
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-testfixtures?expand=0&rev=18
2021-05-12 17:31:20 +00:00
2c6e477710 Accepting request 888956 from devel:languages:python
- Add appease-django-320.patch:
  * Upstream patch to avoid a test failure with building with Django 3.2

OBS-URL: https://build.opensuse.org/request/show/888956
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-testfixtures?expand=0&rev=17
2021-04-29 20:44:43 +00:00
e5c67c8e20 Accepting request 857036 from devel:languages:python
OBS-URL: https://build.opensuse.org/request/show/857036
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-testfixtures?expand=0&rev=16
2020-12-23 13:19:00 +00:00
8458ecf5eb Accepting request 851911 from devel:languages:python
OBS-URL: https://build.opensuse.org/request/show/851911
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-testfixtures?expand=0&rev=15
2020-12-03 17:40:45 +00:00
a18bb680e2 Accepting request 835017 from devel:languages:python
- update to 6.14.2:
  - Fix bug where ``ignore_eq`` had no effect on nested objects when using :func:`compare`
- remove python383.patch (upstream)

OBS-URL: https://build.opensuse.org/request/show/835017
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-testfixtures?expand=0&rev=14
2020-10-29 08:45:23 +00:00
0043605b1d Accepting request 816634 from devel:languages:python
OBS-URL: https://build.opensuse.org/request/show/816634
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-testfixtures?expand=0&rev=13
2020-06-26 19:43:58 +00:00
4c18def873 Accepting request 807182 from devel:languages:python
- Add patch to fix build with python 3.8.3:
  * python383.patch
- Update to 6.14.1:
  * Fix bugs in comparison of :func:`~unittest.mock.call` objects where the :func:`repr` of the :func:`~unittest.mock.call` arguments were the same even when their attributes were not.

OBS-URL: https://build.opensuse.org/request/show/807182
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-testfixtures?expand=0&rev=12
2020-05-20 16:36:19 +00:00
c4312198a4 Accepting request 784177 from devel:languages:python
- Fix build without python2

- version update to 6.14.0
  6.14.0 (24 Feb 2020)
  --------------------
  - Add support for non-deterministic logging order when using :meth:`twisted.LogCapture`.
  6.13.1 (20 Feb 2020)
  --------------------
  - Fix for using :func:`compare` to compare two-element :func:`~unittest.mock.call`
    objects.
  6.13.0 (18 Feb 2020)
  --------------------
  - Allow any attributes that need to be ignored to be specified directly when calling
    :func:`~testfixtures.comparison.compare_object`. This is handy when writing
    comparers for :func:`compare`.
  6.12.1 (16 Feb 2020)
  --------------------
  - Fix a bug that occured when using :func:`compare` to compare a string with a
    slotted object that had the same :func:`repr` as the string.
  6.12.0 (6 Feb 2020)
  -------------------
  - Add support for ``universal_newlines``, ``text``, ``encoding`` and ``errors`` to
    :class:`popen.MockPopen`, but only for Python 3.
  6.11.0 (29 Jan 2020)
  --------------------
  - :class:`decimal.Decimal` now has better representation when :func:`compare` displays a failed
    comparison, particularly on Python 2.
  - Add support to :func:`compare` for explicitly naming objects to be compared as ``x`` and ``y``.
    This allows symmetry with the ``x_label`` and ``y_label`` parameters that are now documented.
  - Restore ability for :class:`Comparison` to compare properties and methods, although these uses

OBS-URL: https://build.opensuse.org/request/show/784177
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-testfixtures?expand=0&rev=11
2020-03-26 23:21:36 +00:00
6376bd8196 Accepting request 717575 from devel:languages:python
- Update to 6.10.0:
  * Better feedback where objects do not :func:`compare` equal but do have the same representation.

OBS-URL: https://build.opensuse.org/request/show/717575
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-testfixtures?expand=0&rev=10
2019-07-22 15:19:50 +00:00
c530fe3247 Accepting request 710324 from devel:languages:python
OBS-URL: https://build.opensuse.org/request/show/710324
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-testfixtures?expand=0&rev=9
2019-06-18 12:57:59 +00:00
f83d3ade71 Accepting request 704380 from devel:languages:python
OBS-URL: https://build.opensuse.org/request/show/704380
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-testfixtures?expand=0&rev=8
2019-05-22 09:15:33 +00:00
d2e30a1c01 Accepting request 696466 from devel:languages:python
OBS-URL: https://build.opensuse.org/request/show/696466
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-testfixtures?expand=0&rev=7
2019-04-22 10:26:23 +00:00
2a31025e9c Accepting request 689260 from devel:languages:python
OBS-URL: https://build.opensuse.org/request/show/689260
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-testfixtures?expand=0&rev=6
2019-03-29 19:42:35 +00:00
895de0b047 Accepting request 674881 from devel:languages:python
OBS-URL: https://build.opensuse.org/request/show/674881
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-testfixtures?expand=0&rev=5
2019-02-27 16:27:54 +00:00
Stephan Kulow
cef330bbad Accepting request 671951 from devel:languages:python
OBS-URL: https://build.opensuse.org/request/show/671951
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-testfixtures?expand=0&rev=4
2019-02-06 14:48:13 +00:00
ec48573907 Accepting request 659711 from devel:languages:python
Remove superfluous devel dependency for noarch package

OBS-URL: https://build.opensuse.org/request/show/659711
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-testfixtures?expand=0&rev=3
2018-12-24 10:45:04 +00:00
417e359c34 Accepting request 561827 from devel:languages:python
OBS-URL: https://build.opensuse.org/request/show/561827
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-testfixtures?expand=0&rev=2
2018-01-06 17:50:58 +00:00
5 changed files with 87 additions and 7 deletions

View File

@@ -1,3 +1,29 @@
-------------------------------------------------------------------
Tue Oct 1 11:13:06 UTC 2024 - Daniel Garcia <daniel.garcia@suse.com>
- Make Django build-requirement conditional and disable by default for
SUSE:SLFO:Main, bsc#1231124
-------------------------------------------------------------------
Thu Sep 26 04:56:43 UTC 2024 - Steve Kowalik <steven.kowalik@suse.com>
- Add patch support-python-313.patch:
* Support Python 3.13 AttributeError message changes.
-------------------------------------------------------------------
Sun Jun 30 08:18:06 UTC 2024 - Dirk Müller <dmueller@suse.com>
- update to 8.3.0:
* :class:`ShouldRaise` now supports :class:`ExceptionGroup`.
* Fixed bug where
:func:`~testfixtures.comparison.compare_generator` did not
respect strict=True.
* Fixed bug in the type annotations for :class:`ShouldRaise`
and :func:`~testfixtures.comparison.compare_exception`.
* :class:`LogCapture` will now raise an exception if closed
while still installed. This can be a source of particularly
confusing bugs.
-------------------------------------------------------------------
Wed May 8 06:08:53 UTC 2024 - Steve Kowalik <steven.kowalik@suse.com>

View File

@@ -24,23 +24,37 @@
%define psuffix %{nil}
%bcond_with test
%endif
%if 0%{?suse_version} == 1600
# No django in SLFO:Main
%bcond_with django
%else
%bcond_without django
%endif
%{?sle15_python_module_pythons}
Name: python-testfixtures%{psuffix}
Version: 8.2.0
Version: 8.3.0
Release: 0
Summary: A collection of helpers and mock objects for unit tests and doc tests
License: MIT
URL: https://github.com/Simplistix/testfixtures
Source: https://files.pythonhosted.org/packages/source/t/testfixtures/testfixtures-%{version}.tar.gz
# PATCH-FIX-UPSTREAM gh#simplistix/testfixtures#202
Patch0: support-python-313.patch
BuildRequires: %{python_module base >= 3.7}
BuildRequires: %{python_module pip}
BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module wheel}
%if %{with test}
%if %{with django}
BuildRequires: %{python_module Django}
BuildRequires: %{python_module pytest-django}
%endif
BuildRequires: %{python_module Twisted}
BuildRequires: %{python_module pytest >= 3.6}
BuildRequires: %{python_module pytest-django}
BuildRequires: %{python_module sybil >= 6}
BuildRequires: %{python_module testfixtures = %{version}}
%endif
@@ -79,9 +93,13 @@ chmod a-x docs/*.txt
%check
%if %{with test}
export DJANGO_SETTINGS_MODULE=testfixtures.tests.test_django.settings
export PYTHONPATH=$(pwd)
%pytest testfixtures/tests
%if %{with django}
export DJANGO_SETTINGS_MODULE=testfixtures.tests.test_django.settings
%else
test_flags="--ignore=testfixtures/tests/test_django"
%endif
%pytest $test_flags testfixtures/tests
%endif
%if %{without test}

36
support-python-313.patch Normal file
View File

@@ -0,0 +1,36 @@
From 291850017e9154b4219fc35d8eca3551724bef94 Mon Sep 17 00:00:00 2001
From: Steve Kowalik <steven@wedontsleep.org>
Date: Thu, 26 Sep 2024 14:50:58 +1000
Subject: [PATCH] Support Python 3.13's AttributeError changes
Python 3.13 has changed the message that is raised with an
AttributeError to provide a hint on how to help avoid it -- but this
breaks a test case. Support both the old and the new message.
---
testfixtures/tests/test_replace.py | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/testfixtures/tests/test_replace.py b/testfixtures/tests/test_replace.py
index 073e43c..863981b 100644
--- a/testfixtures/tests/test_replace.py
+++ b/testfixtures/tests/test_replace.py
@@ -15,6 +15,7 @@
from unittest import TestCase
import os
+import sys
from testfixtures.mock import Mock
from testfixtures.tests import sample1, sample3
@@ -1362,7 +1363,10 @@ def test_invalid_attribute_on_instance_of_slotted_class(self):
obj = OriginE()
assert not hasattr(obj, '__dict__')
replace_ = Replacer()
- with ShouldRaise(AttributeError("'OriginE' object has no attribute 'bad'")):
+ msg = "'OriginE' object has no attribute 'bad'"
+ if sys.version_info >= (3, 13):
+ msg += " and no __dict__ for setting new attributes"
+ with ShouldRaise(AttributeError(msg)):
replace_(obj, name='bad', replacement=42, strict=self.strict)
def test_method_on_instance_of_slotted_subclass(self):

View File

@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:ef43b657134c87e8a3044f4b02a32ae2ebddf44b2b97bc7989a20116403988ee
size 136662

BIN
testfixtures-8.3.0.tar.gz (Stored with Git LFS) Normal file

Binary file not shown.