~nataliabidart/software-center/winged-migration

« back to all changes in this revision

Viewing changes to tests/__init__.py

  • Committer: Natalia B. Bidart
  • Date: 2012-05-30 18:39:55 UTC
  • mto: This revision was merged to the branch mainline in revision 3030.
  • Revision ID: natalia.bidart@canonical.com-20120530183955-zbnjczayktmmg5tv
- Initial test cleanup:
  - Renamed test/ dir to tests/.
  - Isolated test code into tests/ directory, including moving all the
    get_test_window_foo from the gtk3 production modules to
    tests/gtk3/windows.py module.
  - Removed all the calls to Gtk.main() in gtk3 tests since that blocks the
    execution of the suite.
  - Pep8 and pyflakes fixes in the files already modified in this branch.
  - Minor bug fix in the softwarecenter/log.py module when trying to create a
    log dir with proper perms.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
from __future__ import print_function
 
2
 
 
3
import unittest
 
4
 
 
5
 
 
6
class SoftwareCentertTestResult(unittest.TestResult):
 
7
 
 
8
    def startTest(self, test):
 
9
        print('\n\n\n==================================================', test)
 
10
        super(SoftwareCentertTestResult, self).startTest(test)
 
11
 
 
12
    def stopTest(self, test):
 
13
        print('==================================================\n\n\n')
 
14
        super(SoftwareCentertTestResult, self).stopTest(test)
 
15
 
 
16
 
 
17
# Testing frameworks built on top of unittest may want access to the TestResult
 
18
# object generated by running a set of tests for reporting purposes; a TestResult
 
19
# instance is returned by the TestRunner.run() method for this purpose.
 
20
 
 
21
 
 
22
class SoftwareCenterTextTestRunner(unittest.TextTestRunner):
 
23
 
 
24
    def __init__(self, *args, **kwargs):
 
25
        print('\n*********** SoftwareCenterTextTestRunner before', args, kwargs)
 
26
        kwargs['resultclass'] = SoftwareCenterTextTestRunner
 
27
        print('\n*********** SoftwareCenterTextTestRunner after', args, kwargs)
 
28
        super(SoftwareCenterTextTestRunner, self).__init__(*args, **kwargs)
 
29
 
 
30
    #def _makeResult(self):
 
31
    #    return SoftwareCentertTestResult()