eiffel-community / eiffel

The Eiffel framework vocabulary, descriptions, guides and schemas along with links to relevant implementation repositories.
Apache License 2.0
121 stars 59 forks source link

Parameterized tests in test_definitions.py should be optimized #386

Closed magnusbaeck closed 8 months ago

magnusbaeck commented 8 months ago

Description

The parameterized tests in test_definitions.py run slower than needed since all 169 YAML files are loaded for each test case. We can speed this up significantly by loading them once and reusing the resulting list of dicts.

Motivation

Faster unit tests.

Exemplification

On my machine, the execution time for tox -e pytest decreased from 9 s to 3 s after this optimization.

Benefits

Faster unit tests.

Possible Drawbacks

Slightly more complex test code.