File: run-tests.py

package info (click to toggle)
python-pysolr 3.8.1-1
  • links: PTS
  • area: main
  • in suites: buster
  • size: 312 kB
  • sloc: python: 1,704; sh: 166; makefile: 23
file content (31 lines) | stat: -rwxr-xr-x 699 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/usr/bin/env python
# encoding: utf-8

from __future__ import absolute_import, print_function, unicode_literals

import signal
import traceback
import unittest

from tests import utils as test_utils


def main():
    try:
        import faulthandler
        faulthandler.register(signal.SIGUSR1, all_threads=True)
        print('Installed SIGUSR1 handler to print stack traces: pkill -USR1 -f run-tests')
    except ImportError:
        pass

    test_utils.prepare()
    test_utils.start_solr()

    try:
        unittest.main(module='tests', verbosity=1)
    finally:
        print('Tests complete; halting Solr servers…')
        test_utils.stop_solr()

if __name__ == "__main__":
    main()