From eb7eef3a5f81ca93e2d5b1e3c985afe5dfe97967 Mon Sep 17 00:00:00 2001 From: Fu Hanxi Date: Wed, 16 Jul 2025 08:42:58 +0200 Subject: [PATCH] tests: fix special characters in parametrize with variables --- .../pytest_usb_serial_jtag_vfs.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/components/esp_driver_usb_serial_jtag/test_apps/usb_serial_jtag_vfs/pytest_usb_serial_jtag_vfs.py b/components/esp_driver_usb_serial_jtag/test_apps/usb_serial_jtag_vfs/pytest_usb_serial_jtag_vfs.py index 56b70a9bd50..73b8ce3c0c0 100644 --- a/components/esp_driver_usb_serial_jtag/test_apps/usb_serial_jtag_vfs/pytest_usb_serial_jtag_vfs.py +++ b/components/esp_driver_usb_serial_jtag/test_apps/usb_serial_jtag_vfs/pytest_usb_serial_jtag_vfs.py @@ -13,9 +13,10 @@ from pytest_embedded_idf.utils import idf_parametrize ], indirect=True, ) -@pytest.mark.parametrize('test_message', ['test123456789!@#%^&*']) @idf_parametrize('target', ['esp32s3', 'esp32c3', 'esp32c6', 'esp32h2'], indirect=['target']) -def test_usj_vfs_select(dut: Dut, test_message: list) -> None: +def test_usj_vfs_select(dut: Dut) -> None: + test_message = 'test123456789!@#%^&*' + dut.expect_exact('Press ENTER to see the list of tests') dut.write('"test select read, write and timeout"') dut.expect_exact('select timed out', timeout=2) @@ -32,9 +33,10 @@ def test_usj_vfs_select(dut: Dut, test_message: list) -> None: ], indirect=True, ) -@pytest.mark.parametrize('test_message', ['!(@*#&(!*@&#((SDasdkjhad\nce']) @idf_parametrize('target', ['esp32s3', 'esp32c3', 'esp32c6', 'esp32h2'], indirect=['target']) -def test_usj_vfs_read_return(dut: Dut, test_message: list) -> None: +def test_usj_vfs_read_return(dut: Dut) -> None: + test_message = '!(@*#&(!*@&#((SDasdkjhad\nce' + dut.expect_exact('Press ENTER to see the list of tests') dut.write('"read does not return on new line character"') dut.expect_exact('ready to receive', timeout=2) @@ -50,9 +52,10 @@ def test_usj_vfs_read_return(dut: Dut, test_message: list) -> None: ], indirect=True, ) -@pytest.mark.parametrize('test_message', ['testdata']) @idf_parametrize('target', ['esp32s3', 'esp32c3', 'esp32c6', 'esp32h2'], indirect=['target']) -def test_usj_vfs_read_blocking(dut: Dut, test_message: list) -> None: +def test_usj_vfs_read_blocking(dut: Dut) -> None: + test_message = 'testdata' + dut.expect_exact('Press ENTER to see the list of tests') dut.write('"blocking read returns with available data"') dut.expect_exact('ready to receive', timeout=2)