diff options
Diffstat (limited to 'meta-python/recipes-devtools/python')
-rw-r--r-- | meta-python/recipes-devtools/python/python3-betamax/0001-Drop-ptests-fixtures-and-recorde_modes.patch | 42 | ||||
-rw-r--r-- | meta-python/recipes-devtools/python/python3-betamax_0.9.0.bb (renamed from meta-python/recipes-devtools/python/python3-betamax_0.8.1.bb) | 4 |
2 files changed, 27 insertions, 19 deletions
diff --git a/meta-python/recipes-devtools/python/python3-betamax/0001-Drop-ptests-fixtures-and-recorde_modes.patch b/meta-python/recipes-devtools/python/python3-betamax/0001-Drop-ptests-fixtures-and-recorde_modes.patch index 7adcb68324..52745a9373 100644 --- a/meta-python/recipes-devtools/python/python3-betamax/0001-Drop-ptests-fixtures-and-recorde_modes.patch +++ b/meta-python/recipes-devtools/python/python3-betamax/0001-Drop-ptests-fixtures-and-recorde_modes.patch | |||
@@ -1,7 +1,7 @@ | |||
1 | From 0e0b63ae80df5d7849b2e1c5ab9a668e8378b5e8 Mon Sep 17 00:00:00 2001 | 1 | From e5aa66b1af2d49f159c4daefc598f96744ee988d Mon Sep 17 00:00:00 2001 |
2 | From: Zhixiong Chi <zhixiong.chi@windriver.com> | 2 | From: Zhixiong Chi <zhixiong.chi@windriver.com> |
3 | Date: Tue, 28 Mar 2023 06:05:45 +0000 | 3 | Date: Thu, 29 Feb 2024 12:31:58 -0800 |
4 | Subject: [PATCH] Drop ptests fixtures and recorde_modes | 4 | Subject: [PATCH] [PATCH] Drop ptests fixtures and recorde_modes |
5 | 5 | ||
6 | The usage of fixture in test_fixtures has been deprecated. | 6 | The usage of fixture in test_fixtures has been deprecated. |
7 | See https://docs.pytest.org/en/stable/explanation/fixtures.html and | 7 | See https://docs.pytest.org/en/stable/explanation/fixtures.html and |
@@ -12,14 +12,15 @@ re-sold several times, and it adds X-Amzn-Trace-Id header that can possibly | |||
12 | diff for each request. | 12 | diff for each request. |
13 | It leads to ptest failure, so drop it now until we find the solution. | 13 | It leads to ptest failure, so drop it now until we find the solution. |
14 | 14 | ||
15 | Upstream-Status: Inappropriate [oe specific] | 15 | Upstream-Status: Inappropriate [OE-Specific] |
16 | 16 | ||
17 | Signed-off-by: Zhixiong Chi <zhixiong.chi@windriver.com> | 17 | Signed-off-by: Zhixiong Chi <zhixiong.chi@windriver.com> |
18 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
18 | --- | 19 | --- |
19 | tests/integration/test_fixtures.py | 60 ----------- | 20 | tests/integration/test_fixtures.py | 60 ----------- |
20 | tests/integration/test_record_modes.py | 132 ------------------------- | 21 | tests/integration/test_record_modes.py | 141 ------------------------- |
21 | tests/unit/test_fixtures.py | 94 ------------------ | 22 | tests/unit/test_fixtures.py | 94 ----------------- |
22 | 3 files changed, 286 deletions(-) | 23 | 3 files changed, 295 deletions(-) |
23 | delete mode 100644 tests/integration/test_fixtures.py | 24 | delete mode 100644 tests/integration/test_fixtures.py |
24 | delete mode 100644 tests/integration/test_record_modes.py | 25 | delete mode 100644 tests/integration/test_record_modes.py |
25 | delete mode 100644 tests/unit/test_fixtures.py | 26 | delete mode 100644 tests/unit/test_fixtures.py |
@@ -92,10 +93,12 @@ index fc3d1e7..0000000 | |||
92 | - assert True | 93 | - assert True |
93 | diff --git a/tests/integration/test_record_modes.py b/tests/integration/test_record_modes.py | 94 | diff --git a/tests/integration/test_record_modes.py b/tests/integration/test_record_modes.py |
94 | deleted file mode 100644 | 95 | deleted file mode 100644 |
95 | index 58c8846..0000000 | 96 | index 988b851..0000000 |
96 | --- a/tests/integration/test_record_modes.py | 97 | --- a/tests/integration/test_record_modes.py |
97 | +++ /dev/null | 98 | +++ /dev/null |
98 | @@ -1,132 +0,0 @@ | 99 | @@ -1,141 +0,0 @@ |
100 | -import re | ||
101 | - | ||
99 | -from betamax import Betamax, BetamaxError | 102 | -from betamax import Betamax, BetamaxError |
100 | - | 103 | - |
101 | -from tests.integration.helper import IntegrationHelper | 104 | -from tests.integration.helper import IntegrationHelper |
@@ -137,8 +140,15 @@ index 58c8846..0000000 | |||
137 | - # this test to succeed. | 140 | - # this test to succeed. |
138 | - # NOTE(hroncok): httpbin.org added X-Processed-Time header that | 141 | - # NOTE(hroncok): httpbin.org added X-Processed-Time header that |
139 | - # can possibly differ (and often does) | 142 | - # can possibly differ (and often does) |
143 | - r0_content = r0.content.decode(encoding='utf-8', errors='strict') | ||
144 | - r1_content = r1.content.decode(encoding='utf-8', errors='strict') | ||
145 | - r0_content = re.sub('"X-Amzn-Trace-Id": "[^"]+"', '"X-Amzn-Trace-Id": ""', r0_content) | ||
146 | - r1_content = re.sub('"X-Amzn-Trace-Id": "[^"]+"', '"X-Amzn-Trace-Id": ""', r1_content) | ||
147 | - # NOTE(jhatler): httpbin.org added "X-Amzn-Trace-Id" to their | ||
148 | - # response, which is a unique ID that will differ between requests. | ||
149 | - # We remove it from the response body before comparing. | ||
140 | - assert r0_headers == r1_headers | 150 | - assert r0_headers == r1_headers |
141 | - assert r0.content == r1.content | 151 | - assert r0_content == r1_content |
142 | - | 152 | - |
143 | - | 153 | - |
144 | -class TestRecordNone(IntegrationHelper): | 154 | -class TestRecordNone(IntegrationHelper): |
@@ -230,7 +240,7 @@ index 58c8846..0000000 | |||
230 | - assert len(cassette.interactions) == 5 | 240 | - assert len(cassette.interactions) == 5 |
231 | diff --git a/tests/unit/test_fixtures.py b/tests/unit/test_fixtures.py | 241 | diff --git a/tests/unit/test_fixtures.py b/tests/unit/test_fixtures.py |
232 | deleted file mode 100644 | 242 | deleted file mode 100644 |
233 | index 387d9ce..0000000 | 243 | index 41f33eb..0000000 |
234 | --- a/tests/unit/test_fixtures.py | 244 | --- a/tests/unit/test_fixtures.py |
235 | +++ /dev/null | 245 | +++ /dev/null |
236 | @@ -1,94 +0,0 @@ | 246 | @@ -1,94 +0,0 @@ |
@@ -263,9 +273,9 @@ index 387d9ce..0000000 | |||
263 | - # Mock a pytest request object | 273 | - # Mock a pytest request object |
264 | - request = mock.MagicMock() | 274 | - request = mock.MagicMock() |
265 | - request.cls = request.module = None | 275 | - request.cls = request.module = None |
266 | - request.function.__name__ = 'test' | 276 | - request.node.name = request.function.__name__ = 'test' |
267 | - | 277 | - |
268 | - pytest_fixture.betamax_recorder(request) | 278 | - pytest_fixture._betamax_recorder(request) |
269 | - assert request.addfinalizer.called is True | 279 | - assert request.addfinalizer.called is True |
270 | - request.addfinalizer.assert_called_once_with(self.mocked_betamax.stop) | 280 | - request.addfinalizer.assert_called_once_with(self.mocked_betamax.stop) |
271 | - | 281 | - |
@@ -273,9 +283,9 @@ index 387d9ce..0000000 | |||
273 | - # Mock a pytest request object | 283 | - # Mock a pytest request object |
274 | - request = mock.MagicMock() | 284 | - request = mock.MagicMock() |
275 | - request.cls = request.module = None | 285 | - request.cls = request.module = None |
276 | - request.function.__name__ = 'test' | 286 | - request.node.name = request.function.__name__ = 'test' |
277 | - | 287 | - |
278 | - pytest_fixture.betamax_recorder(request) | 288 | - pytest_fixture._betamax_recorder(request) |
279 | - self.mocked_betamax.start.assert_called_once_with() | 289 | - self.mocked_betamax.start.assert_called_once_with() |
280 | - | 290 | - |
281 | - | 291 | - |
@@ -329,5 +339,5 @@ index 387d9ce..0000000 | |||
329 | - | 339 | - |
330 | - recorder.stop.assert_called_once_with() | 340 | - recorder.stop.assert_called_once_with() |
331 | -- | 341 | -- |
332 | 2.35.5 | 342 | 2.44.0 |
333 | 343 | ||
diff --git a/meta-python/recipes-devtools/python/python3-betamax_0.8.1.bb b/meta-python/recipes-devtools/python/python3-betamax_0.9.0.bb index 468a1075b1..a0454686ee 100644 --- a/meta-python/recipes-devtools/python/python3-betamax_0.8.1.bb +++ b/meta-python/recipes-devtools/python/python3-betamax_0.9.0.bb | |||
@@ -7,9 +7,7 @@ SRC_URI += " \ | |||
7 | file://run-ptest \ | 7 | file://run-ptest \ |
8 | file://0001-Drop-ptests-fixtures-and-recorde_modes.patch \ | 8 | file://0001-Drop-ptests-fixtures-and-recorde_modes.patch \ |
9 | " | 9 | " |
10 | 10 | SRC_URI[sha256sum] = "82316e1679bc6879e3c83318d016b54b7c9225ff08c4462de4813e22038d5f94" | |
11 | SRC_URI[md5sum] = "b8182d43a200fc126a3bf7555626f964" | ||
12 | SRC_URI[sha256sum] = "5bf004ceffccae881213fb722f34517166b84a34919b92ffc14d1dbd050b71c2" | ||
13 | 11 | ||
14 | inherit pypi setuptools3 ptest | 12 | inherit pypi setuptools3 ptest |
15 | 13 | ||