~ubuntu-branches/ubuntu/utopic/python-chaco/utopic

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
#!/usr/bin/env python

# Helper script to make it easier to maintain the tests run by
# $ python setup.py test
#
# Run this script when changing the entries of tests at the end of 
# setup.cfg.  This script will only change the line
#   tests = ....
# in setup.cfg.

tests = []

for line in open('setup.cfg'):
    if line.startswith('# test '):
        tests.append(line[6:].strip())

out = []

for line in open('setup.cfg'):
    if line.startswith('tests ='):
        out.append('tests = %s\n' % ','.join(tests))
    else:
        out.append(line)


fo = open('setup.cfg', 'w')
fo.write(''.join(out))
fo.close()