pytest 7.3.2 treats the function name 'setup' as a fixture [1].
This leads to errors like:
TypeError: setup() missing 2 required positional arguments:
'disk_img' and 'osindications'
Rename setup() to capsule_setup().
[1] How to run tests written for nose
https://docs.pytest.org/en/7.3.x/how-to/nose.html
Fixes: 482ef90aeb4c ("test: efi_capsule: refactor efi_capsule test")
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
from capsule_defs import CAPSULE_DATA_DIR, CAPSULE_INSTALL_DIR
-def setup(u_boot_console, disk_img, osindications):
+def capsule_setup(u_boot_console, disk_img, osindications):
"""setup the test
Args:
import pytest
from capsule_common import (
- setup,
+ capsule_setup,
init_content,
place_capsule_file,
exec_manual_update,
disk_img = efi_capsule_data
capsule_files = ['Test05']
with u_boot_console.log.section('Test Case 1-a, before reboot'):
- setup(u_boot_console, disk_img, '0x0000000000000004')
+ capsule_setup(u_boot_console, disk_img, '0x0000000000000004')
init_content(u_boot_console, '100000', 'u-boot.bin.old', 'Old')
init_content(u_boot_console, '150000', 'u-boot.env.old', 'Old')
place_capsule_file(u_boot_console, capsule_files)
disk_img = efi_capsule_data
capsule_files = ['Test04']
with u_boot_console.log.section('Test Case 2-a, before reboot'):
- setup(u_boot_console, disk_img, '0x0000000000000004')
+ capsule_setup(u_boot_console, disk_img, '0x0000000000000004')
init_content(u_boot_console, '100000', 'u-boot.bin.old', 'Old')
init_content(u_boot_console, '150000', 'u-boot.env.old', 'Old')
place_capsule_file(u_boot_console, capsule_files)
disk_img = efi_capsule_data
capsule_files = ['Test104']
with u_boot_console.log.section('Test Case 3-a, before reboot'):
- setup(u_boot_console, disk_img, '0x0000000000000004')
+ capsule_setup(u_boot_console, disk_img, '0x0000000000000004')
init_content(u_boot_console, '100000', 'u-boot.bin.old', 'Old')
init_content(u_boot_console, '150000', 'u-boot.env.old', 'Old')
place_capsule_file(u_boot_console, capsule_files)
disk_img = efi_capsule_data
capsule_files = ['Test105']
with u_boot_console.log.section('Test Case 4-a, before reboot'):
- setup(u_boot_console, disk_img, '0x0000000000000004')
+ capsule_setup(u_boot_console, disk_img, '0x0000000000000004')
init_content(u_boot_console, '100000', 'u-boot.bin.old', 'Old')
place_capsule_file(u_boot_console, capsule_files)
import pytest
from capsule_common import (
- setup,
+ capsule_setup,
init_content,
place_capsule_file,
exec_manual_update,
disk_img = efi_capsule_data
capsule_files = ['Test03']
with u_boot_console.log.section('Test Case 1-a, before reboot'):
- setup(u_boot_console, disk_img, '0x0000000000000004')
+ capsule_setup(u_boot_console, disk_img, '0x0000000000000004')
init_content(u_boot_console, '100000', 'u-boot.bin.old', 'Old')
init_content(u_boot_console, '150000', 'u-boot.env.old', 'Old')
place_capsule_file(u_boot_console, capsule_files)
disk_img = efi_capsule_data
capsule_files = ['Test01', 'Test02']
with u_boot_console.log.section('Test Case 2-a, before reboot'):
- setup(u_boot_console, disk_img, None)
+ capsule_setup(u_boot_console, disk_img, None)
init_content(u_boot_console, '100000', 'u-boot.bin.old', 'Old')
init_content(u_boot_console, '150000', 'u-boot.env.old', 'Old')
place_capsule_file(u_boot_console, capsule_files)
disk_img = efi_capsule_data
capsule_files = ['Test01', 'Test02']
with u_boot_console.log.section('Test Case 3-a, before reboot'):
- setup(u_boot_console, disk_img, '0x0000000000000004')
+ capsule_setup(u_boot_console, disk_img, '0x0000000000000004')
init_content(u_boot_console, '100000', 'u-boot.bin.old', 'Old')
init_content(u_boot_console, '150000', 'u-boot.env.old', 'Old')
place_capsule_file(u_boot_console, capsule_files)
disk_img = efi_capsule_data
capsule_files = ['Test101', 'Test102']
with u_boot_console.log.section('Test Case 4-a, before reboot'):
- setup(u_boot_console, disk_img, '0x0000000000000004')
+ capsule_setup(u_boot_console, disk_img, '0x0000000000000004')
init_content(u_boot_console, '100000', 'u-boot.bin.old', 'Old')
init_content(u_boot_console, '150000', 'u-boot.env.old', 'Old')
place_capsule_file(u_boot_console, capsule_files)
disk_img = efi_capsule_data
capsule_files = ['Test103']
with u_boot_console.log.section('Test Case 5-a, before reboot'):
- setup(u_boot_console, disk_img, '0x0000000000000004')
+ capsule_setup(u_boot_console, disk_img, '0x0000000000000004')
init_content(u_boot_console, '100000', 'u-boot.bin.old', 'Old')
place_capsule_file(u_boot_console, capsule_files)
import pytest
from capsule_common import (
- setup,
+ capsule_setup,
init_content,
place_capsule_file,
exec_manual_update,
disk_img = efi_capsule_data
capsule_files = ['Test13']
with u_boot_console.log.section('Test Case 1-a, before reboot'):
- setup(u_boot_console, disk_img, '0x0000000000000004')
+ capsule_setup(u_boot_console, disk_img, '0x0000000000000004')
init_content(u_boot_console, '100000', 'u-boot.bin.old', 'Old')
place_capsule_file(u_boot_console, capsule_files)
disk_img = efi_capsule_data
capsule_files = ['Test14']
with u_boot_console.log.section('Test Case 2-a, before reboot'):
- setup(u_boot_console, disk_img, '0x0000000000000004')
+ capsule_setup(u_boot_console, disk_img, '0x0000000000000004')
init_content(u_boot_console, '100000', 'u-boot.bin.old', 'Old')
place_capsule_file(u_boot_console, capsule_files)
disk_img = efi_capsule_data
capsule_files = ['Test02']
with u_boot_console.log.section('Test Case 3-a, before reboot'):
- setup(u_boot_console, disk_img, '0x0000000000000004')
+ capsule_setup(u_boot_console, disk_img, '0x0000000000000004')
init_content(u_boot_console, '100000', 'u-boot.bin.old', 'Old')
place_capsule_file(u_boot_console, capsule_files)
disk_img = efi_capsule_data
capsule_files = ['Test114']
with u_boot_console.log.section('Test Case 4-a, before reboot'):
- setup(u_boot_console, disk_img, '0x0000000000000004')
+ capsule_setup(u_boot_console, disk_img, '0x0000000000000004')
init_content(u_boot_console, '100000', 'u-boot.bin.old', 'Old')
place_capsule_file(u_boot_console, capsule_files)
disk_img = efi_capsule_data
capsule_files = ['Test115']
with u_boot_console.log.section('Test Case 5-a, before reboot'):
- setup(u_boot_console, disk_img, '0x0000000000000004')
+ capsule_setup(u_boot_console, disk_img, '0x0000000000000004')
init_content(u_boot_console, '100000', 'u-boot.bin.old', 'Old')
place_capsule_file(u_boot_console, capsule_files)
import pytest
from capsule_common import (
- setup,
+ capsule_setup,
init_content,
place_capsule_file,
exec_manual_update,
disk_img = efi_capsule_data
capsule_files = ['Test11']
with u_boot_console.log.section('Test Case 1-a, before reboot'):
- setup(u_boot_console, disk_img, '0x0000000000000004')
+ capsule_setup(u_boot_console, disk_img, '0x0000000000000004')
init_content(u_boot_console, '100000', 'u-boot.bin.old', 'Old')
place_capsule_file(u_boot_console, capsule_files)
disk_img = efi_capsule_data
capsule_files = ['Test12']
with u_boot_console.log.section('Test Case 2-a, before reboot'):
- setup(u_boot_console, disk_img, '0x0000000000000004')
+ capsule_setup(u_boot_console, disk_img, '0x0000000000000004')
init_content(u_boot_console, '100000', 'u-boot.bin.old', 'Old')
place_capsule_file(u_boot_console, capsule_files)
disk_img = efi_capsule_data
capsule_files = ['Test02']
with u_boot_console.log.section('Test Case 3-a, before reboot'):
- setup(u_boot_console, disk_img, '0x0000000000000004')
+ capsule_setup(u_boot_console, disk_img, '0x0000000000000004')
init_content(u_boot_console, '100000', 'u-boot.bin.old', 'Old')
place_capsule_file(u_boot_console, capsule_files)
disk_img = efi_capsule_data
capsule_files = ['Test111', 'Test112']
with u_boot_console.log.section('Test Case 4-a, before reboot'):
- setup(u_boot_console, disk_img, '0x0000000000000004')
+ capsule_setup(u_boot_console, disk_img, '0x0000000000000004')
init_content(u_boot_console, '100000', 'u-boot.bin.old', 'Old')
place_capsule_file(u_boot_console, capsule_files)
disk_img = efi_capsule_data
capsule_files = ['Test113']
with u_boot_console.log.section('Test Case 5-a, before reboot'):
- setup(u_boot_console, disk_img, '0x0000000000000004')
+ capsule_setup(u_boot_console, disk_img, '0x0000000000000004')
init_content(u_boot_console, '100000', 'u-boot.bin.old', 'Old')
place_capsule_file(u_boot_console, capsule_files)