B2G/QA/Automation/Style Guide/Python Script Style: Difference between revisions

Jump to navigation Jump to search
→‎Variable naming: content added
(→‎Variable naming: content added)
Line 118: Line 118:
When you have to use the sleep() call, make sure to put in the comment explaining why other methods won't work.
When you have to use the sleep() call, make sure to put in the comment explaining why other methods won't work.


== Variable naming ==
== Variable naming <jlorenzo> ==
TBD - jlorenzo
* Name your variables with units.  
* Name your variables with units. For example: timeout_in_seconds, width_in_pixels
<source python>
* Don't shorten variable names. A bad example: self.t_out_err_tim = 1000 instead of self.time_out_error_time
# good
timeout_in_seconds, width_in_pixels
# bad
timeout, width
</source>
* Don't shorten variable names.  
<source python>
# good
self.time_out_error_time = 1000
# bad
self.t_out_err_tim = 1000
</source>


== Making test multi-locale <njpark> ==  
== Making test multi-locale <njpark> ==  
352

edits

Navigation menu