Skip to content

Commit f4e9f5b

Browse files
committed
update
1 parent 3410532 commit f4e9f5b

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

  • python_files/tests/unittestadapter/.data/test_scenarios/tests
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
11
# Copyright (c) Microsoft Corporation. All rights reserved.
22
# Licensed under the MIT License.
33

4+
from testscenarios import generate_scenarios
5+
6+
7+
def load_tests(loader, tests, pattern): # noqa: ARG001
8+
# Pre-expand TestWithScenarios scenarios at load time so individual
9+
# scenario-multiplied test IDs (e.g. ``test_operations(add)``) can be
10+
# resolved by ``unittest.TestLoader.loadTestsFromName``. Without this,
11+
# ``TestWithScenarios`` only multiplies scenarios at ``run()`` time and
12+
# loading a specific scenario by name raises ``AttributeError``.
13+
import unittest
14+
15+
result = unittest.TestSuite()
16+
result.addTests(generate_scenarios(tests))
17+
return result

0 commit comments

Comments
 (0)