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
I've encountered an error where the return values from the generated mocks can be incorrect if the function is called multiple times. For example, given a file to test such as the following:
import os
def my_func(path):
return os.path.dirname(path)
def main():
print my_func('C:/temp')
print my_func('/usr/tmp')
print my_func('/usr/tmp/foo')
if __name__ == '__main__':
main()
In some cases, it will generate the following, incorrect test.
Auger is choosing a random function call to generate a test case for, but is always choosing the first mock, regardless of the call's arguments.
I believe that there is a large advantage to generating test cases for each invocation of a function, especially when refactoring code bases, as you can ensure that a function is well exercised. I have something in my working copy that does this.
The text was updated successfully, but these errors were encountered:
I've encountered an error where the return values from the generated mocks can be incorrect if the function is called multiple times. For example, given a file to test such as the following:
In some cases, it will generate the following, incorrect test.
I believe that this is because of the two following lines:
auger/auger/generator/default.py
Line 119 in a4579f7
auger/auger/generator/default.py
Line 219 in a4579f7
Auger is choosing a random function call to generate a test case for, but is always choosing the first mock, regardless of the call's arguments.
I believe that there is a large advantage to generating test cases for each invocation of a function, especially when refactoring code bases, as you can ensure that a function is well exercised. I have something in my working copy that does this.
The text was updated successfully, but these errors were encountered: