~mgedmin/gtimelog/ehabkost-integration

« back to all changes in this revision

Viewing changes to src/gtimelog/test_gtimelog.py

  • Committer: Marius Gedminas
  • Date: 2011-03-12 19:00:36 UTC
  • Revision ID: marius@gedmin.as-20110312190036-bai3yt5rz0j20wl4
Make 'make test' work again.

Note that 'python setup.py test' doesn't work :/

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
Tests for gtimelog/main.py
4
4
"""
5
5
 
 
6
import sys
6
7
import doctest
7
8
import unittest
8
9
 
11
12
 
12
13
from gtimelog.main import TimeWindow, MainWindow
13
14
 
 
15
 
14
16
def doctest_as_hours():
15
17
    """Tests for as_hours
16
18
 
694
696
        # match a single line:
695
697
        self.assertEquals(self.win.complete('gt'), 'gtimelog: hacking')
696
698
 
697
 
def additional_tests(): # for setup.py
698
 
    return doctest.DocTestSuite(optionflags=doctest.NORMALIZE_WHITESPACE)
699
 
 
700
 
def load_tests(loader, standard_tests, pattern):
701
 
    standard_tests.addTests(additional_tests())
702
 
    return standard_tests
 
699
 
 
700
def test_suite():
 
701
    return unittest.TestSuite([
 
702
        unittest.findTestCases(sys.modules[__name__]),
 
703
        doctest.DocTestSuite(optionflags=doctest.NORMALIZE_WHITESPACE),
 
704
    ])
 
705
 
703
706
 
704
707
def main():
705
 
    unittest.main()
 
708
    unittest.main(module=__name__, defaultTest='test_suite')
706
709
 
707
710
 
708
711
if __name__ == '__main__':