Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions pytest-embedded-wokwi/pytest_embedded_wokwi/wokwi.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,13 @@ def _setup_simulation(self, diagram: str, firmware_path: str, elf_path: str):
self.client.upload_file('pytest.elf', Path(elf_path))
if firmware_path.endswith('flasher_args.json'):
firmware = self.client.upload_idf_firmware(firmware_path)
self.client.start_simulation(firmware.firmware, elf='pytest.elf')
kwargs = {'firmware': firmware.firmware, 'elf': 'pytest.elf', 'flash_size': firmware.flash_size}
else:
firmware = self.client.upload_file('pytest.bin', Path(firmware_path))
self.client.start_simulation(firmware, elf='pytest.elf')
kwargs = {'firmware': firmware, 'elf': 'pytest.elf'}

logging.info('Uploaded diagram and firmware to Wokwi. Starting simulation...')
self.client.start_simulation(**kwargs)

def _start_serial_monitoring(self):
"""Start monitoring serial output and forward to stdout and message queue."""
Expand Down
2 changes: 1 addition & 1 deletion pytest-embedded-wokwi/tests/test_wokwi.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import pytest

wokwi_token_required = pytest.mark.skipif(
os.getenv('WOKWI_CLI_TOKEN') is None,
not os.getenv('WOKWI_CLI_TOKEN', None),
Copy link

Copilot AI Mar 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

os.getenv('WOKWI_CLI_TOKEN', None) passes None as the default, which is already the default for os.getenv. Consider simplifying to os.getenv('WOKWI_CLI_TOKEN') to reduce noise in this skip condition.

Suggested change
not os.getenv('WOKWI_CLI_TOKEN', None),
not os.getenv('WOKWI_CLI_TOKEN'),

Copilot uses AI. Check for mistakes.
reason='Please make sure that `WOKWI_CLI_TOKEN` env var is set. Get a token here: https://wokwi.com/dashboard/ci',
)

Expand Down