forked from pool/python-syrupy
Accepting request 1098482 from home:mcalabkova:branches:devel:languages:python
needed by translate-toolkit tests OBS-URL: https://build.opensuse.org/request/show/1098482 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:pytest/python-syrupy?expand=0&rev=1
This commit is contained in:
23
.gitattributes
vendored
Normal file
23
.gitattributes
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
## Default LFS
|
||||
*.7z filter=lfs diff=lfs merge=lfs -text
|
||||
*.bsp filter=lfs diff=lfs merge=lfs -text
|
||||
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
||||
*.gem filter=lfs diff=lfs merge=lfs -text
|
||||
*.gz filter=lfs diff=lfs merge=lfs -text
|
||||
*.jar filter=lfs diff=lfs merge=lfs -text
|
||||
*.lz filter=lfs diff=lfs merge=lfs -text
|
||||
*.lzma filter=lfs diff=lfs merge=lfs -text
|
||||
*.obscpio filter=lfs diff=lfs merge=lfs -text
|
||||
*.oxt filter=lfs diff=lfs merge=lfs -text
|
||||
*.pdf filter=lfs diff=lfs merge=lfs -text
|
||||
*.png filter=lfs diff=lfs merge=lfs -text
|
||||
*.rpm filter=lfs diff=lfs merge=lfs -text
|
||||
*.tbz filter=lfs diff=lfs merge=lfs -text
|
||||
*.tbz2 filter=lfs diff=lfs merge=lfs -text
|
||||
*.tgz filter=lfs diff=lfs merge=lfs -text
|
||||
*.ttf filter=lfs diff=lfs merge=lfs -text
|
||||
*.txz filter=lfs diff=lfs merge=lfs -text
|
||||
*.whl filter=lfs diff=lfs merge=lfs -text
|
||||
*.xz filter=lfs diff=lfs merge=lfs -text
|
||||
*.zip filter=lfs diff=lfs merge=lfs -text
|
||||
*.zst filter=lfs diff=lfs merge=lfs -text
|
||||
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
.osc
|
||||
18
no-colored.patch
Normal file
18
no-colored.patch
Normal file
@@ -0,0 +1,18 @@
|
||||
Index: syrupy-4.0.4/src/syrupy/terminal.py
|
||||
===================================================================
|
||||
--- syrupy-4.0.4.orig/src/syrupy/terminal.py
|
||||
+++ syrupy-4.0.4/src/syrupy/terminal.py
|
||||
@@ -2,8 +2,12 @@ from typing import (
|
||||
Any,
|
||||
Union,
|
||||
)
|
||||
+import os
|
||||
|
||||
-import colored
|
||||
+try:
|
||||
+ import colored
|
||||
+except ImportError:
|
||||
+ os.environ["DISABLE_COLOR_ENV_VARS"] = "1"
|
||||
|
||||
from .constants import DISABLE_COLOR_ENV_VARS
|
||||
from .utils import get_env_value
|
||||
4
python-syrupy.changes
Normal file
4
python-syrupy.changes
Normal file
@@ -0,0 +1,4 @@
|
||||
-------------------------------------------------------------------
|
||||
Thu Jul 13 08:05:18 UTC 2023 - Markéta Machová <mmachova@suse.com>
|
||||
|
||||
- Initial packaging (v4.0.4), needed by translate-toolkit
|
||||
68
python-syrupy.spec
Normal file
68
python-syrupy.spec
Normal file
@@ -0,0 +1,68 @@
|
||||
#
|
||||
# spec file for package python-syrupy
|
||||
#
|
||||
# Copyright (c) 2023 SUSE LLC
|
||||
#
|
||||
# All modifications and additions to the file contributed by third parties
|
||||
# remain the property of their copyright owners, unless otherwise agreed
|
||||
# upon. The license for this file, and modifications and additions to the
|
||||
# file, is the same license as for the pristine package itself (unless the
|
||||
# license for the pristine package is not an Open Source License, in which
|
||||
# case the license is the MIT License). An "Open Source License" is a
|
||||
# license that conforms to the Open Source Definition (Version 1.9)
|
||||
# published by the Open Source Initiative.
|
||||
|
||||
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
||||
#
|
||||
|
||||
|
||||
Name: python-syrupy
|
||||
Version: 4.0.4
|
||||
Release: 0
|
||||
Summary: Pytest Snapshot Test Utility
|
||||
License: Apache-2.0
|
||||
URL: https://github.com/tophat/syrupy
|
||||
Source: https://github.com/tophat/syrupy/archive/refs/tags/v%{version}.tar.gz#/syrupy-%{version}.tar.gz
|
||||
# PATCH-FIX-OPENSUSE mmachova@suse.com syrupy has a dependency colored (yet another terminal colors), which we don't have in the distribution and I couldn't manage to package it.
|
||||
Patch: no-colored.patch
|
||||
BuildRequires: python-rpm-macros
|
||||
BuildRequires: %{python_module pip}
|
||||
BuildRequires: %{python_module poetry-core >= 1.4.0}
|
||||
BuildRequires: %{python_module pytest >= 7.0.0}
|
||||
BuildRequires: %{python_module pytest-benchmark >= 4.0.0}
|
||||
BuildRequires: %{python_module pytest-xdist >= 3.1.0}
|
||||
BuildRequires: fdupes
|
||||
Requires: python-pytest >= 7.0.0
|
||||
BuildArch: noarch
|
||||
%python_subpackages
|
||||
|
||||
%description
|
||||
Syrupy is a [pytest](https://docs.pytest.org/en/latest/) snapshot plugin. It enables developers to write tests which assert immutability of computed results.
|
||||
|
||||
The most popular snapshot test plugin compatible with pytest has some core limitations which this package attempts to address by upholding some key values:
|
||||
|
||||
- Extensible: If a particular data type is not supported, users should be able to easily and quickly add support.
|
||||
- Idiomatic: Snapshot testing should fit naturally among other test cases in pytest, e.g. `assert x == snapshot` vs. `snapshot.assert_match(x)`.
|
||||
- Soundness: Snapshot tests should uncover even the most minute issues. Unlike other snapshot libraries, Syrupy will fail a test suite if a snapshot does not exist, not just on snapshot differences.
|
||||
|
||||
%prep
|
||||
%autosetup -p1 -n syrupy-%{version}
|
||||
|
||||
%build
|
||||
%pyproject_wheel
|
||||
|
||||
%install
|
||||
%pyproject_install
|
||||
%python_expand %fdupes %{buildroot}%{$python_sitelib}
|
||||
|
||||
%check
|
||||
# test_colors_off_does_not_call_colored - actually needs to access colored
|
||||
%pytest -k "not test_colors_off_does_not_call_colored"
|
||||
|
||||
%files %{python_files}
|
||||
%doc README.md
|
||||
%license LICENSE
|
||||
%{python_sitelib}/syrupy
|
||||
%{python_sitelib}/syrupy-%{version}.dist-info
|
||||
|
||||
%changelog
|
||||
3
syrupy-4.0.4.tar.gz
Normal file
3
syrupy-4.0.4.tar.gz
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:e1e5f8059d2eccd4f9f9360300936ae5bb6d5b5a7d3d5af6d160844bf9f6e624
|
||||
size 2300770
|
||||
Reference in New Issue
Block a user