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
While running tests on my code I was doing something like:
classData:
mylist= [1,2,3,4]
deftest_function():
local_list=Data.mylistlocal_list+=new_list# Do stuff with
and there are multiple tests using mylist. This is going to modify the list instead of creating a new one, an unexpected behavior of +=. This will let one test talk to the tests happening later. The safer approach is:
classData:
mylist= [1,2,3,4]
deftest_function():
local_list=new_list+Data.mylist# Do stuff with
here + will copy the list. Could you please add this case?
Cheers.
The text was updated successfully, but these errors were encountered:
Hi,
While running tests on my code I was doing something like:
and there are multiple tests using
mylist
. This is going to modify the list instead of creating a new one, an unexpected behavior of+=
. This will let one test talk to the tests happening later. The safer approach is:here
+
will copy the list. Could you please add this case?Cheers.
The text was updated successfully, but these errors were encountered: