From 93a67a8ad77f2539258181ba52090fe9774d756dba081ea75727622fa32ce859 Mon Sep 17 00:00:00 2001 From: Steve Kowalik Date: Fri, 19 Jan 2024 03:30:22 +0000 Subject: [PATCH] - Drop patch also-skip-streaming.patch: * No longer needed. - Add BuildRequires on new stripe-mock service, and run it during the check phase. OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-stripe?expand=0&rev=8 --- also-skip-streaming.patch | 43 --------------------------------------- python-stripe.changes | 8 ++++++++ python-stripe.spec | 8 +++++--- 3 files changed, 13 insertions(+), 46 deletions(-) delete mode 100644 also-skip-streaming.patch diff --git a/also-skip-streaming.patch b/also-skip-streaming.patch deleted file mode 100644 index c5810d6..0000000 --- a/also-skip-streaming.patch +++ /dev/null @@ -1,43 +0,0 @@ -Index: stripe-7.12.0/tests/conftest.py -=================================================================== ---- stripe-7.12.0.orig/tests/conftest.py -+++ stripe-7.12.0/tests/conftest.py -@@ -48,9 +48,9 @@ def pytest_addoption(parser): - - - def pytest_runtest_setup(item): -- if "http_client_mock" in item.fixturenames and item.config.getoption( -- "--nomock" -- ): -+ if (any([f in item.fixturenames -+ for f in ("http_client_mock", "http_client_mock_streaming")]) and -+ item.config.getoption("--nomock")): - pytest.skip( - "run stripe-mock locally and remove --nomock flag to run skipped tests" - ) -Index: stripe-7.12.0/tests/api_resources/test_invoice.py -=================================================================== ---- stripe-7.12.0.orig/tests/api_resources/test_invoice.py -+++ stripe-7.12.0/tests/api_resources/test_invoice.py -@@ -137,7 +137,7 @@ class TestInvoice(object): - ) - assert isinstance(resource, stripe.Invoice) - -- def test_can_iterate_lines(self): -+ def test_can_iterate_lines(self, http_client_mock): - resource = stripe.Invoice.retrieve(TEST_RESOURCE_ID) - assert isinstance(resource.lines.data, list) - assert isinstance(resource.lines.data[0], stripe.InvoiceLineItem) -Index: stripe-7.12.0/tests/api_resources/test_invoice_line_item.py -=================================================================== ---- stripe-7.12.0.orig/tests/api_resources/test_invoice_line_item.py -+++ stripe-7.12.0/tests/api_resources/test_invoice_line_item.py -@@ -5,7 +5,7 @@ TEST_INVOICE_ID = "in_123" - - - class TestInvoiceLineItem(object): -- def test_deserialize(self): -+ def test_deserialize(self, http_client_mock): - invoice = stripe.Invoice.retrieve(TEST_INVOICE_ID) - assert isinstance(invoice.lines.data, list) - assert isinstance(invoice.lines.data[0], stripe.InvoiceLineItem) diff --git a/python-stripe.changes b/python-stripe.changes index a49ccdc..14ffdf4 100644 --- a/python-stripe.changes +++ b/python-stripe.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Fri Jan 19 03:23:20 UTC 2024 - Steve Kowalik + +- Drop patch also-skip-streaming.patch: + * No longer needed. +- Add BuildRequires on new stripe-mock service, and run it during the + check phase. + ------------------------------------------------------------------- Wed Jan 17 03:12:47 UTC 2024 - Steve Kowalik diff --git a/python-stripe.spec b/python-stripe.spec index b0c38e0..6c2277c 100644 --- a/python-stripe.spec +++ b/python-stripe.spec @@ -25,8 +25,6 @@ URL: https://github.com/stripe/stripe-python Source: https://files.pythonhosted.org/packages/source/s/stripe/stripe-%{version}.tar.gz # PATCH-FIX-UPSTREAM gh#stripe/stripe-python#1195 Patch0: use-sys-executable.patch -# PATCH-FIX-OPENSUSE Skip tests that require mocked stripe service running -Patch1: also-skip-streaming.patch BuildRequires: %{python_module pip} BuildRequires: %{python_module pytest >= 6.0} BuildRequires: %{python_module pytest-mock >= 2.0} @@ -36,6 +34,7 @@ BuildRequires: %{python_module typing_extensions >= 4.5.0} BuildRequires: %{python_module wheel} BuildRequires: fdupes BuildRequires: python-rpm-macros +BuildRequires: stripe-mock Requires: python-requests >= 2.20 Requires: python-typing_extensions >= 4.5.0 Conflicts: python-stripe-api @@ -56,7 +55,10 @@ Python bindings for the Stripe API. %python_expand %fdupes %{buildroot}%{$python_sitelib} %check -%pytest --nomock +stripe-mock & +pid=$! +%pytest +kill $pid %files %{python_files} %doc CHANGELOG.md README.md examples/