Closed Bug 837887 Opened 11 years ago Closed 11 years ago

test_preferences.py should print out the command line on failure

Categories

(Testing :: Mozbase, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 837897

People

(Reporter: k0scist, Unassigned)

References

Details

(Whiteboard: [good first bug][mentor=jhammel][lang=py])

https://github.com/mozilla/mozbase/blob/master/mozprofile/tests/test_preferences.py#L14

Currently we get such helpful output as:

"""
ERROR: test_basic_prefs (test_preferences.PreferencesTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File
  "/home/jhammel/mozilla/src/mozilla-central/testing/mozbase/mozprofile/tests/test_preferences.py",
  line 49, in test_basic_prefs
    self.compare_generated(_prefs, commandline)
  File
  "/home/jhammel/mozilla/src/mozilla-central/testing/mozbase/mozprofile/tests/test_preferences.py",
  line 34, in compare_generated
    profile, stderr, code = self.run_command(*commandline)
  File
  "/home/jhammel/mozilla/src/mozilla-central/testing/mozbase/mozprofile/tests/test_preferences.py",
  line 21, in run_command
    stderr=subprocess.PIPE)
  File "/usr/lib/python2.7/subprocess.py", line 679, in __init__
    errread, errwrite)
  File "/usr/lib/python2.7/subprocess.py", line 1249, in
  _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory
"""

This isn't very helpful :(  If we print out the command on failure
(non-zero exit code) or exception (this case) it would be much easier
to figure out what is actually going on.
Whiteboard: [good first bug][mentor=jhammel][lang=py]
See Also: → 837897
if we end up taking bug 837897, this is no longer necessary and we can resolve
(In reply to Jeff Hammel [:jhammel] from comment #1)
> if we end up taking bug 837897, this is no longer necessary and we can
> resolve

And we did :) More specifically, the approach that kills shelling out in the test.  Closing as a dupe
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.