Compare commits
10 Commits
6d63d5a94f
...
6de180c379
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6de180c379 | ||
|
|
9d1afc9b8f | ||
|
|
72097eb3f2 | ||
|
|
518b3f5273 | ||
|
|
7d3f70f193 | ||
|
|
7c9eda012a | ||
|
|
4cf1c8a682 | ||
|
|
0044cfc2c0 | ||
|
|
a5416e4730 | ||
|
|
96dfc7f7a9 |
46
pytest-Use-Node.from_parent.patch
Normal file
46
pytest-Use-Node.from_parent.patch
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
From 8e06097d68b3f2fb9f44324119de5cefb7a42506 Mon Sep 17 00:00:00 2001
|
||||||
|
From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= <miro@hroncok.cz>
|
||||||
|
Date: Mon, 7 Jun 2021 00:52:25 +0200
|
||||||
|
Subject: [PATCH] pytest: Use Node.from_parent(...)
|
||||||
|
|
||||||
|
Fixes https://github.com/docopt/docopt/issues/483
|
||||||
|
|
||||||
|
See https://docs.pytest.org/en/stable/deprecations.html#node-construction-changed-to-node-from-parent
|
||||||
|
---
|
||||||
|
conftest.py | 13 +++++++++++--
|
||||||
|
1 file changed, 11 insertions(+), 2 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/conftest.py b/conftest.py
|
||||||
|
index f5e8c7b..c4c0bb5 100644
|
||||||
|
--- a/conftest.py
|
||||||
|
+++ b/conftest.py
|
||||||
|
@@ -11,7 +11,10 @@ import docopt
|
||||||
|
|
||||||
|
def pytest_collect_file(path, parent):
|
||||||
|
if path.ext == ".docopt" and path.basename.startswith("test"):
|
||||||
|
- return DocoptTestFile(path, parent)
|
||||||
|
+ if hasattr(DocoptTestFile, "from_parent"):
|
||||||
|
+ return DocoptTestFile.from_parent(parent, fspath=path)
|
||||||
|
+ else:
|
||||||
|
+ return DocoptTestFile(path, parent)
|
||||||
|
|
||||||
|
|
||||||
|
def parse_test(raw):
|
||||||
|
@@ -41,7 +44,13 @@ class DocoptTestFile(pytest.File):
|
||||||
|
for name, doc, cases in parse_test(raw):
|
||||||
|
name = self.fspath.purebasename
|
||||||
|
for case in cases:
|
||||||
|
- yield DocoptTestItem("%s(%d)" % (name, index), self, doc, case)
|
||||||
|
+ if hasattr(DocoptTestItem, "from_parent"):
|
||||||
|
+ yield DocoptTestItem.from_parent(parent=self,
|
||||||
|
+ name="%s(%d)" % (name, index),
|
||||||
|
+ doc=doc,
|
||||||
|
+ case=case)
|
||||||
|
+ else:
|
||||||
|
+ yield DocoptTestItem("%s(%d)" % (name, index), self, doc, case)
|
||||||
|
index += 1
|
||||||
|
|
||||||
|
|
||||||
|
--
|
||||||
|
2.27.0
|
||||||
|
|
||||||
@ -1,11 +1,14 @@
|
|||||||
Name: python-docopt
|
Name: python-docopt
|
||||||
Version: 0.6.2
|
Version: 0.6.2
|
||||||
Release: 11
|
Release: 14
|
||||||
Summary: Command-line interface description language
|
Summary: Command-line interface description language
|
||||||
License: MIT
|
License: MIT
|
||||||
URL: http://docopt.org/
|
URL: http://docopt.org/
|
||||||
Source0: https://github.com/docopt/docopt/archive/%{version}.tar.gz#/docopt-%{version}.tar.gz
|
Source0: https://github.com/docopt/docopt/archive/%{version}.tar.gz#/docopt-%{version}.tar.gz
|
||||||
|
|
||||||
|
#patch
|
||||||
|
Patch0000: pytest-Use-Node.from_parent.patch
|
||||||
|
|
||||||
BuildArch: noarch
|
BuildArch: noarch
|
||||||
|
|
||||||
%global _description \
|
%global _description \
|
||||||
@ -17,13 +20,6 @@ formalized.
|
|||||||
|
|
||||||
%description %_description
|
%description %_description
|
||||||
|
|
||||||
%package -n python2-docopt
|
|
||||||
Summary: Command-line interface description language
|
|
||||||
%{?python_provide:%python_provide python2-docopt}
|
|
||||||
BuildRequires: python2-devel python2-pytest python2-setuptools
|
|
||||||
|
|
||||||
%description -n python2-docopt %_description
|
|
||||||
|
|
||||||
%package -n python3-docopt
|
%package -n python3-docopt
|
||||||
Summary: Command-line interface description language
|
Summary: Command-line interface description language
|
||||||
%{?python_provide:%python_provide python3-docopt}
|
%{?python_provide:%python_provide python3-docopt}
|
||||||
@ -35,22 +31,14 @@ BuildRequires: python3-devel python3-pytest python3-setuptools
|
|||||||
%autosetup -n docopt-%{version} -p1
|
%autosetup -n docopt-%{version} -p1
|
||||||
|
|
||||||
%build
|
%build
|
||||||
%py2_build
|
|
||||||
%py3_build
|
%py3_build
|
||||||
|
|
||||||
%install
|
%install
|
||||||
%py2_install
|
|
||||||
%py3_install
|
%py3_install
|
||||||
|
|
||||||
%check
|
%check
|
||||||
py.test-2.7 -v
|
|
||||||
py.test-3 -v
|
py.test-3 -v
|
||||||
|
|
||||||
%files -n python2-docopt
|
|
||||||
%license LICENSE-MIT
|
|
||||||
%doc README.rst
|
|
||||||
%{python2_sitelib}/*
|
|
||||||
|
|
||||||
%files -n python3-docopt
|
%files -n python3-docopt
|
||||||
%license LICENSE-MIT
|
%license LICENSE-MIT
|
||||||
%doc README.rst
|
%doc README.rst
|
||||||
@ -58,5 +46,14 @@ py.test-3 -v
|
|||||||
%{python3_sitelib}/__pycache__/*
|
%{python3_sitelib}/__pycache__/*
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Wed Oct 26 2022 zhangruifang <zhangruifang1@h-partners.com> - 0.6.2-14
|
||||||
|
- Rebuild for next release
|
||||||
|
|
||||||
|
* Thu Oct 28 2021 xuping <xuping33@huawei.com> - 0.6.2-13
|
||||||
|
- pytest Use Node.from_parent to fix some testcase failed.
|
||||||
|
|
||||||
|
* Sat Oct 24 2020 tianwei <tianwei12@huawei.com> - 0.6.2-12
|
||||||
|
- delete python2
|
||||||
|
|
||||||
* Wed Jan 08 2020 zhouyihang <zhouyihang1@huawei.com> - 0.6.2-11
|
* Wed Jan 08 2020 zhouyihang <zhouyihang1@huawei.com> - 0.6.2-11
|
||||||
- Package init
|
- Package init
|
||||||
|
|||||||
4
python-docopt.yaml
Normal file
4
python-docopt.yaml
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
version_control: github
|
||||||
|
src_repo: docopt/docopt
|
||||||
|
tag_prefix: ^v
|
||||||
|
seperator: .
|
||||||
Loading…
x
Reference in New Issue
Block a user