Skip to content

Commit 6a59e54

Browse files
Merge pull request #58 from LedgerHQ/fbe/fix_output_pytest_directories_for_v2
Fbe/fix output pytest directories for v2
2 parents c22b25d + de2ad3d commit 6a59e54

4 files changed

Lines changed: 13 additions & 7 deletions

File tree

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [0.12.3] - 2025-11-06
9+
10+
### Fixed
11+
12+
- Fix `output_pytest_directories` option for v2 manifests
13+
814
## [0.12.2] - 2025-07-21
915

1016
### Fixed

src/ledgered/manifest/cli.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -256,15 +256,15 @@ def main() -> None: # pragma: no cover
256256
sys.exit(2)
257257
test_config = repo_manifest.pytests[0]
258258
if isinstance(test_config, TestsConfig):
259+
# Legacy format, only one possible directory to return so we return it
259260
display_content["tests"]["pytest_directory"] = str(test_config.pytest_directory)
260261
elif isinstance(test_config, PyTestsConfig):
262+
# If we have several pytests, we look for the [standalone] one
261263
for cfg in repo_manifest.pytests:
262264
assert isinstance(cfg, PyTestsConfig)
263-
if "standalone" in str(cfg.directory):
265+
if cfg.key == "standalone":
266+
display_content["tests"]["pytest_directory"] = str(cfg.directory)
264267
break
265-
assert isinstance(cfg, PyTestsConfig)
266-
if "standalone" in str(cfg.directory):
267-
display_content["tests"]["pytest_directory"] = str(cfg.directory)
268268
else:
269269
logger.error(
270270
"This manifest contains a [pytests] field, but no [tests] field. "

tests/_data/full_correct_v2.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ test_with_feature_activated = "TEST_FLAG_TO_SET=1"
1212
directory = "./unit-tests/"
1313

1414
[pytest.standalone]
15-
directory = "tests/standalone"
15+
directory = "tests/path_to_st_tests"
1616

1717
[pytest.swap]
1818
directory = "tests/swap"
@@ -25,4 +25,4 @@ testing_with_latest = [
2525
testing_with_prod = [
2626
{url = "https://github.com/LedgerHQ/app-exchange", ref = "master"},
2727
{url = "https://github.com/LedgerHQ/app-ethereum", ref = "master"}
28-
]
28+
]

tests/functional/test_github.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def test_get_app(gh):
2020

2121
def test_exchange_manifest(exchange):
2222
assert exchange.manifest.app.sdk == "c"
23-
assert len(exchange.manifest.app.devices) == 4
23+
assert len(exchange.manifest.app.devices) == 5
2424

2525

2626
def test_exchange_makefile_path(exchange):

0 commit comments

Comments
 (0)