We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3410532 commit f4e9f5bCopy full SHA for f4e9f5b
1 file changed
python_files/tests/unittestadapter/.data/test_scenarios/tests/__init__.py
@@ -1,3 +1,17 @@
1
# Copyright (c) Microsoft Corporation. All rights reserved.
2
# Licensed under the MIT License.
3
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