Re:Show HN: Touca – open-source superior alternative to snap...
by spuz on Tuesday February 28, 2023 @02:50AM
(#34966756)
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?
[ Parent
| on HN ]
Re:Show HN: Touca – open-source superior alternative to snap...
by pejman_gh on Tuesday February 28, 2023 @03:17AM
(#34966929)
Hello! 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-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.