mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-01-26 23:23:33 +00:00
Bug 888506 - Check that the start_time attribute exists before trying to use it. r=jgriffin
This commit is contained in:
parent
158694a98f
commit
4ef150e60c
@ -247,7 +247,8 @@ permissions.forEach(function (perm) {
|
|||||||
self._deleteSession()
|
self._deleteSession()
|
||||||
|
|
||||||
def _deleteSession(self):
|
def _deleteSession(self):
|
||||||
self.duration = time.time() - self.start_time
|
if hasattr(self, 'start_time'):
|
||||||
|
self.duration = time.time() - self.start_time
|
||||||
if hasattr(self.marionette, 'session'):
|
if hasattr(self.marionette, 'session'):
|
||||||
if self.marionette.session is not None:
|
if self.marionette.session is not None:
|
||||||
try:
|
try:
|
||||||
|
@ -0,0 +1,34 @@
|
|||||||
|
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||||
|
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||||
|
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||||
|
|
||||||
|
from marionette_test import MarionetteTestCase, SkipTest
|
||||||
|
|
||||||
|
class TestSetUpSkipped(MarionetteTestCase):
|
||||||
|
|
||||||
|
testVar = {'test':'SkipTest'}
|
||||||
|
|
||||||
|
def setUp(self):
|
||||||
|
try:
|
||||||
|
self.testVar['email']
|
||||||
|
except KeyError:
|
||||||
|
raise SkipTest('email key not present in dict, skip ...')
|
||||||
|
MarionetteTestCase.setUp(self)
|
||||||
|
|
||||||
|
def test_assert(self):
|
||||||
|
assert True
|
||||||
|
|
||||||
|
class TestSetUpNotSkipped(MarionetteTestCase):
|
||||||
|
|
||||||
|
testVar = {'test':'SkipTest'}
|
||||||
|
|
||||||
|
def setUp(self):
|
||||||
|
try:
|
||||||
|
self.testVar['test']
|
||||||
|
except KeyError:
|
||||||
|
raise SkipTest('email key not present in dict, skip ...')
|
||||||
|
MarionetteTestCase.setUp(self)
|
||||||
|
|
||||||
|
def test_assert(self):
|
||||||
|
assert True
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user