3 ms·
In the example in the README it says "Touca tests do not hard-code input values" and yet it hardcodes inputs of the find_students function to "Alice", "Bob" and
by spuz 4y ago
In the example in the README it says "Touca tests do not hard-code input values" and yet it hardcodes inputs of the find_students function to "Alice", "Bob" and "Charlie". Is this a mistake? How does touca produce inputs if they are not hardcoded?
- pejman_gh 4y agoHello! Sorry for the confusion. What we mean is that, unlike unit testing, the test inputs are not tightly coupled with the test code and you can write a single block of test code and have it executed for any number of inputs. The example in Readme is passing the inputs as a list. You could also use a lambda function (see https://touca.io/docs/sdk/testcases/#programmatic-testcase-declaration https://touca.io/docs/sdk/testcases/#programmatic-testcase-d...). Alternatively, you can remove the list and pass the inputs as command-line arguments. You can even choose not to pass them at all, in which case the test runner will re-use the list of test cases in the baseline version.