Merge lp:~sylvain-pineau/checkbox/gpu_test_2to3 into lp:checkbox
Proposed by
Sylvain Pineau
Status: | Merged |
---|---|
Merged at revision: | 1419 |
Proposed branch: | lp:~sylvain-pineau/checkbox/gpu_test_2to3 |
Merge into: | lp:checkbox |
Diff against target: |
195 lines (+57/-31) (has conflicts) 2 files modified
debian/changelog (+5/-0) scripts/gpu_test (+52/-31) Text conflict in debian/changelog |
To merge this branch: | bzr merge lp:~sylvain-pineau/checkbox/gpu_test_2to3 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Marc Tardif (community) | Approve | ||
Sylvain Pineau (community) | Needs Resubmitting | ||
Review via email:
|
Description of the change
gpu_test conversion to python 3.
pexpect dependency removed, and Flash/firefox test is now launched with normal user.
To post a comment you must log in.
1. I noticed you are now checking that the script runs as root. Instead of checking for the UID, I would suggest you check for the effective UID. What do you think?
The rest looks good as far as the conversion is concerned, and I really like how you had the courage to replace pexpect in the gpu_test script. If you have a moment, I have a few syntactic suggestions:
1. When using the with statement, the variable assigned to the output of the given function is typically only used within the scope of the code block. This is not a problem with this merge request, nor does it prevent the code from working because Python variables continue existing outside of some code blocks. So, I would suggest using the self.tempfile variable instead of f outside the with code block:
'sudo -H -u %s firefox %s' % (os.getenv(
2. When specifying an encoding to the encode() method, I would suggest not passing anything instead of "utf-8" that is the default value anyways.
3. I noticed that you changed the type of x_res, y_res, hsize and vsize to integers. So, instead of casting the division of those variables to int, you might like to use integer division instead:
DesktopSwitch = ChangeViewport(
hsize, vsize, x_res // hsize, y_res // vsize)