summaryrefslogtreecommitdiffstats
path: root/meta-python/recipes-devtools/python
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2025-12-09 23:31:01 -0800
committerKhem Raj <raj.khem@gmail.com>2025-12-10 08:56:15 -0800
commitec4c278bc970113ea04487d531a8c391c690d5cb (patch)
treef5bea19fceec46efdb6b139ec23a72aec4f49efe /meta-python/recipes-devtools/python
parenta145ddffdec1f549428f724e0a4969a2155b99cb (diff)
downloadmeta-openembedded-ec4c278bc970113ea04487d531a8c391c690d5cb.tar.gz
python3-betamax: Skip ptests accessing network
cassette fixtures are not installed in ptests so skip test_requests_with_json_body Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'meta-python/recipes-devtools/python')
-rw-r--r--meta-python/recipes-devtools/python/python3-betamax/0001-test_placeholders-use-pytest-vcr-or-skip-if-cassette.patch40
-rw-r--r--meta-python/recipes-devtools/python/python3-betamax_0.9.0.bb1
2 files changed, 41 insertions, 0 deletions
diff --git a/meta-python/recipes-devtools/python/python3-betamax/0001-test_placeholders-use-pytest-vcr-or-skip-if-cassette.patch b/meta-python/recipes-devtools/python/python3-betamax/0001-test_placeholders-use-pytest-vcr-or-skip-if-cassette.patch
new file mode 100644
index 0000000000..64ff9be249
--- /dev/null
+++ b/meta-python/recipes-devtools/python/python3-betamax/0001-test_placeholders-use-pytest-vcr-or-skip-if-cassette.patch
@@ -0,0 +1,40 @@
1From a7f1d08e073e60167c6ac9c72a0110c65f87a937 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Tue, 9 Dec 2025 23:04:45 -0800
4Subject: [PATCH] test_placeholders: use pytest-vcr or skip if cassette missing
5
6Upstream-Status: Inappropriate [OE ptest specific]
7
8Signed-off-by: Khem Raj <raj.khem@gmail.com>
9---
10 tests/integration/test_placeholders.py | 5 +++++
11 1 file changed, 5 insertions(+)
12
13--- a/tests/integration/test_placeholders.py
14+++ b/tests/integration/test_placeholders.py
15@@ -1,3 +1,6 @@
16+import pytest
17+import os
18+
19 from betamax import Betamax
20 from betamax.cassette import Cassette
21
22@@ -18,6 +21,8 @@ class TestPlaceholders(IntegrationHelper
23 super(TestPlaceholders, self).tearDown()
24 Cassette.default_cassette_options = original_cassette_options
25
26+ @pytest.mark.skipif(not os.path.exists('tests/cassettes/test_placeholders.json'),
27+ reason="Cassette fixture missing")
28 def test_placeholders_work(self):
29 placeholders = Cassette.default_cassette_options['placeholders']
30 assert placeholders == [{
31--- a/tests/regression/test_requests_2_11_body_matcher.py
32+++ b/tests/regression/test_requests_2_11_body_matcher.py
33@@ -13,6 +13,7 @@ class TestRequests211BodyMatcher(unittes
34
35 @pytest.mark.skipif(requests.__build__ < 0x020401,
36 reason="No json keyword.")
37+ @pytest.mark.skip(reason="Requires cassette fixture not available in ptest")
38 def test_requests_with_json_body(self):
39 s = requests.Session()
40 with Betamax(s).use_cassette('requests_2_11_body_matcher',
diff --git a/meta-python/recipes-devtools/python/python3-betamax_0.9.0.bb b/meta-python/recipes-devtools/python/python3-betamax_0.9.0.bb
index f88d43a21a..8dbd21a938 100644
--- a/meta-python/recipes-devtools/python/python3-betamax_0.9.0.bb
+++ b/meta-python/recipes-devtools/python/python3-betamax_0.9.0.bb
@@ -10,6 +10,7 @@ SRC_URI += " \
10 file://run-ptest \ 10 file://run-ptest \
11 git://github.com/betamaxpy/betamax;protocol=https;branch=main \ 11 git://github.com/betamaxpy/betamax;protocol=https;branch=main \
12 file://0001-Drop-ptests-fixtures-and-recorde_modes.patch \ 12 file://0001-Drop-ptests-fixtures-and-recorde_modes.patch \
13 file://0001-test_placeholders-use-pytest-vcr-or-skip-if-cassette.patch \
13" 14"
14 15
15 16