You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe:
I want unit tests to use KCL modules that the module under test does not use. I do not want the module under test to require said dependency only because it is used in unit tests.
As an example: the existing unit test framework is very poor at providing information needed for a developer to diagnose why an assertion fails. The minimum expectation of a reasonable assertion would be to print the value of the "actual" upon failure. Better would be to print a diff between the "actual" and "expected" for assertions that have both.
The difflib module is the start of something that could be built into an assertions module, but the issue is how to get tests to depend on an assertions module without having the module under test depend on that same module.
Describe the feature you'd like:
Probably a [test_dependences] section in kcl.mod. This would be used by the kcl test command. It would probably also be updated by the kcl mod update command.
Possibly add a --test flag to kcl mod add.
Describe alternatives you've considered:
Users could make the package under test add the dependency. This is usually undesirable.
The language could create new variants of the assert command which do the comparisons and emit the output. But this would not allow the set of comparisons to be reasonably extended.
Feature Request
Is your feature request related to a problem? Please describe:
I want unit tests to use KCL modules that the module under test does not use. I do not want the module under test to require said dependency only because it is used in unit tests.
As an example: the existing unit test framework is very poor at providing information needed for a developer to diagnose why an assertion fails. The minimum expectation of a reasonable assertion would be to print the value of the "actual" upon failure. Better would be to print a diff between the "actual" and "expected" for assertions that have both.
The
difflib
module is the start of something that could be built into an assertions module, but the issue is how to get tests to depend on an assertions module without having the module under test depend on that same module.Describe the feature you'd like:
Probably a
[test_dependences]
section in kcl.mod. This would be used by thekcl test
command. It would probably also be updated by thekcl mod update
command.Possibly add a
--test
flag tokcl mod add
.Describe alternatives you've considered:
Users could make the package under test add the dependency. This is usually undesirable.
The language could create new variants of the
assert
command which do the comparisons and emit the output. But this would not allow the set of comparisons to be reasonably extended.Print-a-diff could be put into the core language.
Teachability, Documentation, Adoption, Migration Strategy:
testing.assert_equal(actual, expected)
would print a diff from expected to actual if the two values are not equal.The text was updated successfully, but these errors were encountered: