Esempio n. 1
0
    def _format_test(self, test, result):
        color = 'green' if result else 'red'
        files = ''

        if not test.all_files:
            files = ' (%s)' % Settings.short_path(test.changed)

        return colored('%s%s' % (test.name, files), color)
Esempio n. 2
0
    def _format_test(self, test, result):
        color = 'green' if result else 'red'
        files = ''

        if not test.all_files:
            files = ' (%s)' % Settings.short_path(test.changed)

        return colored('%s%s' % (test.name, files), color)
Esempio n. 3
0
    def _format_test(self, test, result):
        color = 'green' if result else 'red'
        files = ''
        all_files = getattr(test, 'all_files', True)
        name = (getattr(test, 'name', None) or getattr(test, '__name__', None)
                or 'test')

        if not all_files:
            files = ' (%s)' % Settings.short_path(test.changed)

        return colored('%s%s' % (name, files), color)
Esempio n. 4
0
def main():
    """Configure testtube and begins watching for file changes."""
    # Configure the app based on passed arguments
    Settings.configure(*get_arguments())
    renderer = Renderer()

    observer = Observer()
    observer.schedule(PyChangeHandler(), Settings.SRC_DIR, recursive=True)
    observer.start()

    renderer.notice(
        'testtube is now watching %s for changes...\n' % Settings.SRC_DIR)

    try:
        while True:
            time.sleep(1)
    except KeyboardInterrupt:
        observer.stop()

    observer.join()
Esempio n. 5
0
def main():
    """Configure testtube and begins watching for file changes."""
    # Configure the app based on passed arguments
    Settings.configure(*get_arguments())
    renderer = Renderer()

    observer = Observer()
    observer.daemon = True
    observer.schedule(PyChangeHandler(), Settings.SRC_DIR, recursive=True)
    observer.start()

    observer.join(1)  # Give the observer thread some time to start up.
    renderer.notice('testtube is now watching %s for changes...\n' %
                    Settings.SRC_DIR)

    try:
        while True:
            observer.join(1)
    except KeyboardInterrupt:
        pass
Esempio n. 6
0
    def _format_test(self, test, result):
        color = 'green' if result else 'red'
        files = ''
        all_files = getattr(test, 'all_files', True)
        name = (
            getattr(test, 'name', None) or getattr(test, '__name__', None) or
            'test')

        if not all_files:
            files = ' (%s)' % Settings.short_path(test.changed)

        return colored('%s%s' % (name, files), color)