From 6962a4462318e8730bace75ad2e22adcb23718af596195ec03996ecbb4ef8dd5 Mon Sep 17 00:00:00 2001 From: Dominique Leuenberger Date: Tue, 16 May 2017 12:28:46 +0000 Subject: [PATCH] Accepting request 492870 from devel:languages:python needed for new python-requests OBS-URL: https://build.opensuse.org/request/show/492870 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-pytest-mock?expand=0&rev=1 --- .gitattributes | 23 ++++++++++++ .gitignore | 1 + pytest-mock-1.6.0.tar.gz | 3 ++ python-pytest-mock.changes | 14 +++++++ python-pytest-mock.spec | 76 ++++++++++++++++++++++++++++++++++++++ 5 files changed, 117 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 pytest-mock-1.6.0.tar.gz create mode 100644 python-pytest-mock.changes create mode 100644 python-pytest-mock.spec diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -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 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/pytest-mock-1.6.0.tar.gz b/pytest-mock-1.6.0.tar.gz new file mode 100644 index 0000000..5d65ad3 --- /dev/null +++ b/pytest-mock-1.6.0.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:83a17cbcd4dbc7c6c9dc885a0d598f9acd11f2d5142e0718ed32e14538670c1f +size 17780 diff --git a/python-pytest-mock.changes b/python-pytest-mock.changes new file mode 100644 index 0000000..75b6aa4 --- /dev/null +++ b/python-pytest-mock.changes @@ -0,0 +1,14 @@ +------------------------------------------------------------------- +Wed Apr 5 12:22:45 UTC 2017 - jmatejek@suse.com + +- update to 1.6.0 + * original assertions now appear in failure message +- shorten summary +- add requirements on mock and pytest +- enable tests + +------------------------------------------------------------------- +Thu Mar 9 09:06:36 UTC 2017 - okurz@suse.com + +- Initial singlespec submission + diff --git a/python-pytest-mock.spec b/python-pytest-mock.spec new file mode 100644 index 0000000..96a79bd --- /dev/null +++ b/python-pytest-mock.spec @@ -0,0 +1,76 @@ +# +# spec file for package python-pytest-mock +# +# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany. +# +# 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 http://bugs.opensuse.org/ +# + + +%{?!python_module:%define python_module() python-%{**} python3-%{**}} +%define modname pytest-mock +Name: python-%{modname} +Version: 1.6.0 +Release: 0 +Summary: Thin-wrapper around the mock package for easier use with pytest +License: MIT +Group: Development/Languages/Python +Url: https://github.com/pytest-dev/%{modname} +Source: https://files.pythonhosted.org/packages/source/p/%{modname}/%{modname}-%{version}.tar.gz +BuildRequires: %{python_module setuptools_scm} +BuildRequires: %{python_module setuptools} +BuildRequires: %{python_module pytest} +BuildRequires: %{python_module virtualenv} +%if 0%{?suse_version} < 1330 +BuildRequires: python-mock +%else +BuildRequires: python2-mock +%endif +BuildRequires: python-rpm-macros +Requires: python-pytest +%ifpython2 +Requires: python-mock +%else +Recommends: python-mock +%endif +BuildRoot: %{_tmppath}/%{name}-%{version}-build +BuildArch: noarch + +%python_subpackages + +%description +This plugin installs a ``mocker`` fixture which is a thin-wrapper around the patching API +provided by the `mock` package, +but with the benefit of not having to worry about undoing patches at the end +of a test + +%prep +%setup -q -n %{modname}-%{version} + +%build +%python_build + +%install +%python_install + +%check +%{python_expand $python -m virtualenv --system-site-packages env-%{$python_bin_suffix} +. env-%{$python_bin_suffix}/bin/activate +$python setup.py install +$python -m pytest test_pytest_mock.py +deactivate } + +%files %{python_files} +%defattr(-,root,root,-) +%{python_sitelib}/* + +%changelog