Fix "mutable" object as default value
This patch fix the coding issue where "mutable" objects like list, dict are being used as default value of param. Current functions with mutable object as default value can create issues if they will be called in more random order. For example - first call with non default value and then with default value. In this case original default will be overridden by the first function call (as mutable object keep their state among function calls). This commit also add the hacking check for the same and its corresponding test. Closes-Bug: #1330322 Change-Id: I251b316ef6d37f4b95c5e8d73a20a39005c22870
This commit is contained in:
@@ -12,6 +12,7 @@ Tempest Specific Commandments
|
||||
- [T104] Scenario tests require a services decorator
|
||||
- [T105] Unit tests cannot use setUpClass
|
||||
- [T106] vim configuration should not be kept in source files.
|
||||
- [N322] Method's default argument shouldn't be mutable
|
||||
|
||||
Test Data/Configuration
|
||||
-----------------------
|
||||
|
||||
Reference in New Issue
Block a user