.gear/rules | 3 ++ .gear/tags/list | 1 + .gear/upstream/remotes | 3 ++ .gear/vcrpy.spec | 92 ++++++++++++++++++++++++++++++++++++++++++++++++ setup.py | 2 +- tests/unit/test_stubs.py | 6 ++++ tox.ini | 2 +- 7 files changed, 107 insertions(+), 2 deletions(-) diff --git a/.gear/rules b/.gear/rules new file mode 100644 index 0000000..521e00a --- /dev/null +++ b/.gear/rules @@ -0,0 +1,3 @@ +spec: .gear/vcrpy.spec +tar: v@version@:. +diff: v@version@:. . name=@name@-@version@-alt.patch diff --git a/.gear/tags/list b/.gear/tags/list new file mode 100644 index 0000000..90896d6 --- /dev/null +++ b/.gear/tags/list @@ -0,0 +1 @@ +c79a06f639dd628536c9868044e78df1012985f9 v4.1.1 diff --git a/.gear/upstream/remotes b/.gear/upstream/remotes new file mode 100644 index 0000000..b6f002d --- /dev/null +++ b/.gear/upstream/remotes @@ -0,0 +1,3 @@ +[remote "upstream"] + url = https://github.com/kevin1024/vcrpy.git + fetch = +refs/heads/*:refs/remotes/upstream/* diff --git a/.gear/vcrpy.spec b/.gear/vcrpy.spec new file mode 100644 index 0000000..e046b4b --- /dev/null +++ b/.gear/vcrpy.spec @@ -0,0 +1,92 @@ +%define _unpackaged_files_terminate_build 1 +%define oname vcrpy + +%def_with check + +Name: python3-module-%oname +Version: 4.1.1 +Release: alt2 +Summary: Automatically mock your HTTP interactions to simplify and speed up testing +License: MIT +Group: Development/Python3 +Url: https://pypi.org/project/vcrpy/ + +# https://github.com/kevin1024/vcrpy.git +Source: %name-%version.tar +Patch0: %name-%version-alt.patch +BuildArch: noarch + +BuildRequires(pre): rpm-build-python3 + +%if_with check +# install_requires= +BuildRequires: python3(wrapt) +BuildRequires: python3(yaml) +BuildRequires: python3(yarl) +BuildRequires: python3(six) + +BuildRequires: python3(pytest) +BuildRequires: python3(tox) +BuildRequires: python3(tox_console_scripts) +%endif + +%description +Automatically mock your HTTP interactions to simplify and speed up +testing. + +%prep +%setup +%autopatch -p1 + +# don't package boto stubs, this code should be unreachable with boto3 +rm vcr/stubs/boto_stubs.py + +%build +%python3_build + +%install +%python3_install + +%check +cat > tox.ini <<'EOF' +[testenv] +commands = + {envbindir}/pytest -vra {posargs:tests} +EOF +export PIP_NO_BUILD_ISOLATION=no +export PIP_NO_INDEX=YES +export TOXENV=py3 +export REQUIRES_INTERNET=yes +export TOX_TESTENV_PASSENV='REQUIRES_INTERNET' +tox.py3 --sitepackages --console-scripts -vvr --develop -- tests/unit + +%files +%doc LICENSE.txt README.rst +%python3_sitelibdir/* + +%changelog +* Wed Mar 09 2022 Stanislav Levin 4.1.1-alt2 +- Dropped dependency on unmaintained and unused boto. + +* Mon Oct 19 2020 Stanislav Levin 4.1.1-alt1 +- 1.2.0 -> 4.1.1. + +* Sat Aug 01 2020 Grigory Ustinov 1.2.0-alt2.git20150108 +- Drop python2 support. + +* Fri Feb 02 2018 Stanislav Levin 1.2.0-alt1.git20150108.1.1.1 +- (NMU) Fix Requires and BuildRequires to python-setuptools + +* Sun Mar 13 2016 Ivan Zakharyaschev 1.2.0-alt1.git20150108.1.1 +- (NMU) rebuild with rpm-build-python3-0.1.9 + (for common python3/site-packages/ and auto python3.3-ABI dep when needed) + +* Thu Jan 28 2016 Mikhail Efremov 1.2.0-alt1.git20150108.1 +- NMU: Use buildreq for BR. + +* Tue Jan 27 2015 Eugeny A. Rostovtsev (REAL) 1.2.0-alt1.git20150108 +- Version 1.2.0 + +* Sat Nov 08 2014 Eugeny A. Rostovtsev (REAL) 1.1.2-alt1.git20141103 +- Initial build for Sisyphus + diff --git a/setup.py b/setup.py index 0eece40..8d58d94 100644 --- a/setup.py +++ b/setup.py @@ -63,7 +63,7 @@ setup( python_requires=">=3.5", install_requires=install_requires, license="MIT", - tests_require=["pytest", "mock", "pytest-httpbin"], + tests_require=["pytest", "mock"], classifiers=[ "Development Status :: 5 - Production/Stable", "Environment :: Console", diff --git a/tests/unit/test_stubs.py b/tests/unit/test_stubs.py index c952fad..d9c3673 100644 --- a/tests/unit/test_stubs.py +++ b/tests/unit/test_stubs.py @@ -1,5 +1,8 @@ +import os from unittest import mock +import pytest + from vcr import mode from vcr.stubs import VCRHTTPSConnection from vcr.cassette import Cassette @@ -12,6 +15,9 @@ class TestVCRConnection: assert vcr_connection.real_connection.ssl_version == "example_ssl_version" @mock.patch("vcr.cassette.Cassette.can_play_response_for", return_value=False) + @pytest.mark.skipif( + "REQUIRES_INTERNET" in os.environ, reason="Requires internet" + ) def testing_connect(*args): vcr_connection = VCRHTTPSConnection("www.google.com") vcr_connection.cassette = Cassette("test", record_mode=mode.ALL) diff --git a/tox.ini b/tox.ini index d64f6fe..677ad73 100644 --- a/tox.ini +++ b/tox.ini @@ -61,7 +61,7 @@ basepython = python3.7 # for aggregate code coverage combine usedevelop=true commands = - ./runtests.sh --cov=./vcr --cov-branch --cov-report=xml --cov-append {posargs} + ./runtests.sh {posargs} deps = Flask pytest