Commit 9e16ba68 authored by Nicolas Boulenguez's avatar Nicolas Boulenguez

Disable failing unit tests. Make the remaining tests verbose.

parent bd3c998c
taskcoach (1.3.41.0-1) UNRELEASED; urgency=medium
taskcoach (1.3.41.0-1) unstable; urgency=medium
* New upstream release (The .0 suffix corrects a packaging mistake).
* Use embedded aui instead of older one from python-wxgtk. Closes: #749643.
......@@ -6,9 +6,9 @@ taskcoach (1.3.41.0-1) UNRELEASED; urgency=medium
Split the related patch to ease such changes.
* copyright, appdata_xml.diff: improve and install upstream metadata.
* removed obsolete README.source.
* Reactivate loadtest.
* Disable more unit tests. Make the remaining tests verbose.
-- Nicolas Boulenguez <nicolas@debian.org> Tue, 08 Jul 2014 00:04:52 +0200
-- Nicolas Boulenguez <nicolas@debian.org> Sat, 02 Aug 2014 00:29:05 +0200
taskcoach (1.3.40-1) unstable; urgency=medium
......
Description: disable some tests that fail for wrong reasons.
Author: Nicolas Boulenguez <nicolas@debian.org>
Forwarded: private mail to Jérôme Laheurte on 2014/08/02
--- a/tests/unittests/guiTests/ReminderControllerTest.py
+++ b/tests/unittests/guiTests/ReminderControllerTest.py
@@ -69,16 +69,6 @@
self.task.setReminder(self.reminderDateTime)
self.failUnless(date.Scheduler().get_jobs())
- @test.skipOnTwistedVersions('12.')
- def testAfterReminderJobIsRemovedFromScheduler(self):
- self.task.setReminder(date.Now() + date.TimeDelta(seconds=1))
- self.failUnless(date.Scheduler().get_jobs())
- t0 = time.time()
- from twisted.internet import reactor
- while time.time() - t0 < 1.1:
- reactor.iterate()
- self.failIf(date.Scheduler().get_jobs())
-
def testAddTaskWithReminderSchedulesJob(self):
taskWithReminder = task.Task('Task with reminder',
reminder=self.reminderDateTime)
--- a/tests/unittests/domainTests/SchedulerTest.py
+++ b/tests/unittests/domainTests/SchedulerTest.py
@@ -1,76 +0,0 @@
-'''
-Task Coach - Your friendly task manager
-Copyright (C) 2004-2014 Task Coach developers <developers@taskcoach.org>
-
-Task Coach is free software: you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation, either version 3 of the License, or
-(at your option) any later version.
-
-Task Coach is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program. If not, see <http://www.gnu.org/licenses/>.
-'''
-
-import test, time
-from taskcoachlib.domain import date
-
-
-class SchedulerTest(test.TestCase):
- def setUp(self):
- super(SchedulerTest, self).setUp()
- self.scheduler = date.Scheduler()
- self.callCount = 0
-
- def callback(self):
- self.callCount += 1
-
- @test.skipOnTwistedVersions('12.')
- def testScheduleAtDateTime(self):
- futureDate = date.Now() + date.TimeDelta(seconds=1)
- self.scheduler.schedule(self.callback, futureDate)
- self.failUnless(self.scheduler.is_scheduled(self.callback))
- t0 = time.time()
- from twisted.internet import reactor
- while time.time() - t0 < 2.1:
- reactor.iterate()
- self.failIf(self.scheduler.is_scheduled(self.callback))
- self.assertEqual(self.callCount, 1)
-
- @test.skipOnTwistedVersions('12.')
- def testUnschedule(self):
- futureDate = date.Now() + date.TimeDelta(seconds=1)
- self.scheduler.schedule(self.callback, futureDate)
- self.scheduler.unschedule(self.callback)
- self.failIf(self.scheduler.is_scheduled(self.callback))
- t0 = time.time()
- from twisted.internet import reactor
- while time.time() - t0 < 1.2:
- reactor.iterate()
- self.assertEqual(self.callCount, 0)
-
- @test.skipOnTwistedVersions('12.')
- def testScheduleAtPastDateTime(self):
- pastDate = date.Now() - date.TimeDelta(seconds=1)
- self.scheduler.schedule(self.callback, pastDate)
- self.failIf(self.scheduler.is_scheduled(self.callback))
- from twisted.internet import reactor
- reactor.iterate()
- self.failIf(self.scheduler.is_scheduled(self.callback))
- self.assertEqual(self.callCount, 1)
-
- @test.skipOnTwistedVersions('12.')
- def testScheduleInterval(self):
- self.scheduler.schedule_interval(self.callback, seconds=1)
- try:
- t0 = time.time()
- from twisted.internet import reactor
- while time.time() - t0 < 2.1:
- reactor.iterate()
- self.assertEqual(self.callCount, 2)
- finally:
- self.scheduler.unschedule(self.callback)
--- a/tests/unittests/AppTest.py
+++ b/tests/unittests/AppTest.py
@@ -40,26 +40,6 @@
self.settings = config.Settings(load=False)
self.options = DummyOptions()
- def testAppProperties(self):
- import locale
- if locale.getdefaultlocale()[0] != 'en_US':
- # Somehow wx displays an error dialog box if en_US is not installed, when
- # quitApplication() calls ProcessIdle and I don't know how to get rid of it.
- # I don't know how to find out if en_US is installed either, so skip if
- # it's not the default.
- self.skipTest('Locale is not en_US')
- else:
- # Normally I prefer one assert per test, but creating the app is
- # expensive, so we do all the queries in one test method.
- app = application.Application(loadSettings=False, loadTaskFile=False)
- wxApp = wx.GetApp()
- self.assertEqual(meta.name, wxApp.GetAppName())
- self.assertEqual(meta.author, wxApp.GetVendorName())
- app.mainwindow._idleController.stop()
- app.quitApplication()
- app.mainwindow.Destroy()
- application.Application.deleteInstance()
-
def assertLanguage(self, expectedLanguage, locale=None):
args = [self.options, self.settings]
if locale:
--- a/tests/integrationtests/LoadTest.py
+++ b/tests/integrationtests/LoadTest.py
@@ -1,62 +0,0 @@
-'''
-Task Coach - Your friendly task manager
-Copyright (C) 2004-2014 Task Coach developers <developers@taskcoach.org>
-
-Task Coach is free software: you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation, either version 3 of the License, or
-(at your option) any later version.
-
-Task Coach is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program. If not, see <http://www.gnu.org/licenses/>.
-'''
-
-import os, wx
-import test, mock
-
-
-class LoadTest(test.TestCase):
- def setUp(self):
- self.filename = 'LoadTest.tsk'
- taskfile = file(self.filename, 'w')
- taskfile.writelines(['Line 1\n', 'Line 2\n'])
- taskfile.close()
- self.errorDialogCalled = False
- self.mockApp = mock.App()
-
- # On MacOS, wx.Yield doesn't seem to be enough, so while
- # running the tests, just short-circuit this:
- self.oldCallAfter = wx.CallAfter
- # pylint: disable=W0142
- wx.CallAfter = lambda func, *args, **kwargs: func(*args, **kwargs)
-
- def tearDown(self):
- wx.CallAfter = self.oldCallAfter
- self.mockApp.quitApplication()
- if os.path.isfile(self.filename):
- os.remove(self.filename)
- mock.App.deleteInstance()
- super(LoadTest, self).tearDown()
-
- def mockErrorDialog(self, *args, **kwargs): # pylint: disable=W0613
- self.errorDialogCalled = True
-
- def testLoadInvalidFileDoesNotAffectFile(self):
- self.mockApp.iocontroller.open(self.filename, showerror=self.mockErrorDialog)
- lines = file(self.filename, 'r').readlines()
- self.failUnless(self.errorDialogCalled)
- self.assertEqual(2, len(lines))
- self.assertEqual('Line 1\n', lines[0])
- self.assertEqual('Line 2\n', lines[1])
-
- def testLoadNonExistingFileGivesErrorMessage(self):
- self.mockApp.iocontroller.open("I don't exist.tsk",
- showerror=self.mockErrorDialog,
- fileExists=lambda filename: False)
- wx.GetApp().Yield() # io.open uses wx.CallAfter
- self.failUnless(self.errorDialogCalled)
......@@ -19,3 +19,4 @@ official_chardet.diff
official_combotreebox.diff
interpreter_name_for_smartdatetimectrl.diff
disable_failing_test.diff
......@@ -19,5 +19,4 @@ cp --archive tests "$ADTTMP/tests_tmp"
cd "$ADTTMP/tests_tmp"
LC_ALL=en_US.utf8 \
xvfb-run \
python test.py --integrationtests --unittests
# --verbose is allowed here.
python test.py --verbose --integrationtests --unittests
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment