File: run_tests.py

package info (click to toggle)
python-dbfread 2.0.7-5
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 384 kB
  • sloc: python: 1,146; makefile: 140
file content (25 lines) | stat: -rwxr-xr-x 507 bytes parent folder | download | duplicates (4)
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
#!/usr/bin/env python
"""
Runs tests in Python 2 and 3.
 
If you want tests to run before each commit you can install this as
a pre-commit hook:

   ln -sf ../../run_tests.py .git/hooks/pre-commit

The commit will now be canceled if tests fail.
"""
import os
import sys
sys.path.insert(0, '.')

def print_yellow(message):
    print('\033[0;33m{}\033[0m'.format(message))

print_yellow('Python 2')
if os.system('py.test'):
    sys.exit(1)

print_yellow('Python 3')
if os.system('py.test-3'):
    sys.exit(1)