!10 [sync] PR-6: add python 3.9 & use pytest instead of nose

From: @openeuler-sync-bot 
Reviewed-by: @myeuler 
Signed-off-by: @myeuler
This commit is contained in:
openeuler-ci-bot 2022-05-06 01:34:31 +00:00 committed by Gitee
commit 1f5f53fe4e
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
3 changed files with 188 additions and 3 deletions

108
Add-Python-3.9.patch Normal file
View File

@ -0,0 +1,108 @@
From a2da58f5b396605c8f0ba3e793551d7541e8a7b7 Mon Sep 17 00:00:00 2001
From: chen-jan <chen_aka_jan@163.com>
Date: Tue, 11 Jan 2022 14:32:37 +0800
Subject: [PATCH 1/2] Add Python 3.9
---
setup.py | 10 +++++++---
tox.ini | 35 ++++++++++++++---------------------
2 files changed, 21 insertions(+), 24 deletions(-)
diff --git a/setup.py b/setup.py
index 1caf74c..c2bd9d1 100644
--- a/setup.py
+++ b/setup.py
@@ -13,14 +13,17 @@ install_requires = [
]
tests_require = [
- 'nose<1.3.0', 'coverage', 'mock',
- 'PasteDeploy', 'WSGIProxy2', 'pyquery'
+ 'coverage',
+ 'PasteDeploy',
+ 'pyquery',
+ 'pytest',
+ 'WSGIProxy2',
]
docs_extras = [
- 'Sphinx >= 1.8.1',
'docutils',
'pylons-sphinx-themes >= 1.0.8',
+ 'Sphinx >= 1.8.1',
]
setup(name='WebTest',
@@ -41,6 +44,7 @@ setup(name='WebTest',
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
+ "Programming Language :: Python :: 3.9",
],
keywords='wsgi test unit tests web',
author='Ian Bicking',
diff --git a/tox.ini b/tox.ini
index d33bfb0..4bfa137 100644
--- a/tox.ini
+++ b/tox.ini
@@ -1,43 +1,36 @@
[tox]
skip_missing_interpreters=true
-envlist=py27,py35,py36,py37,py38,coverage,docs
+envlist=py27,py35,py36,py37,py38,py39,coverage,docs
[testenv]
-skip_install=true
setenv =
- LC_ALL=C
- LANG=C
- COVERAGE_FILE=.coverage.{envname}
-deps =
- pytest
- -e .[tests,docs]
- lxml
- pyquery
- BeautifulSoup4
- PasteDeploy
- WSGIProxy2
- coverage
+ LC_ALL=C
+ LANG=C
+ COVERAGE_FILE=.coverage.{envname}
+extras =
+ tests
commands =
- python --version
- pip freeze
- coverage run {envbindir}/pytest -xv []
- coverage report --show-missing
+ python --version
+ pip freeze
+ coverage run {envbindir}/pytest -xv []
+ coverage report --show-missing
[testenv:coverage]
skip_install=false
skipsdist=true
+depends = py36,py37,py38,py39
deps =
coverage
setenv =
- COVERAGE_FILE=.coverage
+ COVERAGE_FILE=.coverage
commands =
{envbindir}/coverage erase
{envbindir}/coverage combine
{envbindir}/coverage xml
- {envbindir}/coverage report --show-missing
+ {envbindir}/coverage report --show-missing --fail-under=100
[testenv:docs]
-basepython = python3.6
+basepython = python3.9
whitelist_externals = make
commands =
make -C docs html BUILDDIR={envdir} "SPHINXOPTS=-W -E"
--
2.30.0

70
Install-pytest-cov.patch Normal file
View File

@ -0,0 +1,70 @@
From d3074969e1c9671564176dbf3a656b01f12b58b5 Mon Sep 17 00:00:00 2001
From: chen-jan <chen_aka_jan@163.com>
Date: Tue, 11 Jan 2022 14:36:00 +0800
Subject: [PATCH 2/2] Install pytest cov
---
docs/contributing.rst | 2 +-
setup.cfg | 12 ------------
setup.py | 2 +-
3 files changed, 2 insertions(+), 14 deletions(-)
diff --git a/docs/contributing.rst b/docs/contributing.rst
index 9d2a7bb..f2acbbb 100644
--- a/docs/contributing.rst
+++ b/docs/contributing.rst
@@ -23,7 +23,7 @@ Execute tests
.. code-block:: bash
- $ bin/nosetests
+ $ bin/pytest
Doctest: forms.rst ... ok
Doctest: index.rst ... ok
diff --git a/setup.cfg b/setup.cfg
index 448dae5..08ac3f5 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -4,18 +4,6 @@ dev = develop easy_install webtest[tests]
[bdist_wheel]
universal=1
-[nosetests]
-verbosity=2
-detailed-errors = True
-with-doctest = True
-doctest-extension = rst
-doctest-fixtures = _fixt
-# XXX: docs/index.rst requires lxml
-include = docs
-exclude = (CHANGELOG|changelog|contributing).rst
-cover-package=webtest
-doctest-options = +ELLIPSIS,+NORMALIZE_WHITESPACE
-
[tool:pytest]
addopts = -p no:warnings
--doctest-modules
diff --git a/setup.py b/setup.py
index c2bd9d1..c532524 100644
--- a/setup.py
+++ b/setup.py
@@ -17,6 +17,7 @@ tests_require = [
'PasteDeploy',
'pyquery',
'pytest',
+ 'pytest-cov',
'WSGIProxy2',
]
@@ -62,7 +63,6 @@ setup(name='WebTest',
include_package_data=True,
zip_safe=False,
install_requires=install_requires,
- test_suite='nose.collector',
tests_require=tests_require,
extras_require={
'tests': tests_require,
--
2.30.0

View File

@ -1,15 +1,18 @@
Name: python-webtest
Version: 2.0.35
Release: 1
Release: 2
Summary: Helper to test WSGI-based web applications
License: MIT
URL: https://github.com/Pylons/webtest
Source0: https://github.com/Pylons/webtest/archive/%{version}.tar.gz
BuildArch: noarch
BuildRequires: python3-devel, python3-setuptools, python3-nose, python3-beautifulsoup4, python3-paste-deploy
BuildRequires: python3-devel, python3-setuptools, python3-pytest, python3-pytest-cov, python3-beautifulsoup4, python3-paste-deploy
BuildRequires: python3-pyquery, python3-six, python3-waitress, python3-webob, python3-WSGIProxy2, python3-pylons-sphinx-themes
Patch0001: Add-Python-3.9.patch
Patch0002: Install-pytest-cov.patch
%description
WebTest helps you test your WSGI-based web applications. This can be
any application that has a WSGI interface, including an application
@ -51,7 +54,7 @@ cd -
%check
cd %{_builddir}/python3-%{name}-%{version}
LANG=en_US.utf8
PYTHONPATH=$(pwd) nosetests-%{python3_version}
PYTHONPATH=$(pwd) pytest-%{python3_version}
cd -
%files -n python3-webtest
@ -59,6 +62,10 @@ cd -
%{python3_sitelib}/*
%changelog
* Tue Jan 11 2022 Chen Chen <chen_aka_jan@163.com> - 2.0.35-2
- add python 3.9
- use pytest instead of nose
* Thu Jan 14 2021 yanglongkang <yanglongkang@huawei.com> - 2.0.35-1
- update version 2.0.35