forked from spyder-ide/spyder
-
Notifications
You must be signed in to change notification settings - Fork 0
/
runtests.py
39 lines (29 loc) · 919 Bytes
/
runtests.py
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
32
33
34
35
36
37
38
39
# -*- coding: utf-8 -*-
#
# Copyright © Spyder Project Contributors
# Licensed under the terms of the MIT License
#
"""
File for running tests programmatically.
"""
# Standard library imports
import os
# Third party imports
import qtpy # to ensure that Qt4 uses API v2
import pytest
# To activate/deactivate certain things for pytest's only
os.environ['SPYDER_PYTEST'] = 'True'
def main():
"""
Run pytest tests.
"""
errno = pytest.main(['-x', 'spyder', '-v', '-rw', '--durations=10',
'--cov=spyder', '--cov-report=term-missing'])
# sys.exit doesn't work here because some things could be running
# in the background (e.g. closing the main window) when this point
# is reached. And if that's the case, sys.exit does't stop the
# script (as you would expected).
if errno != 0:
raise SystemExit(errno)
if __name__ == '__main__':
main()