Skip to content
This repository was archived by the owner on Apr 30, 2025. It is now read-only.

Commit 324b2c6

Browse files
committed
Add a run-tests script which runs unit tests and pyflakes both.
Fix pyflakes warnings.
1 parent 23560a5 commit 324b2c6

File tree

4 files changed

+28
-3
lines changed

4 files changed

+28
-3
lines changed

HACKING

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,11 @@ Running Tests
3030
Tests are run using `test_suite` from setuptools and rely on the mock and
3131
bzrlib.tests packages. So you must install the 'python-setuptools,'
3232
'python-mock', and `python-bzrlib.tests` packages in order to run the tests.
33-
Once done, from the top of the repository you can run:
33+
Tarmac also uses 'pyflakes' to do static code checking. You will need to
34+
install the 'pyflakes' package as well, to ensure your changes do not report
35+
any new warnings. Once done, from the top of the repository you can run:
3436

35-
% ./setup.py test
37+
% ./run-tests
3638

3739
=============
3840
Writing Tests

run-tests

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/bin/bash
2+
#
3+
# Copyright 2010-2013 Canonical Ltd.
4+
#
5+
# This program is free software: you can redistribute it and/or modify it
6+
# under the terms of the GNU General Public License version 3, as published
7+
# by the Free Software Foundation.
8+
#
9+
# This program is distributed in the hope that it will be useful, but
10+
# WITHOUT ANY WARRANTY; without even the implied warranties of
11+
# MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
12+
# PURPOSE. See the GNU General Public License for more details.
13+
#
14+
# You should have received a copy of the GNU General Public License along
15+
# with this program. If not, see <http://www.gnu.org/licenses/>.
16+
set -e -x
17+
18+
# Run the tests
19+
python ./setup.py build test clean
20+
21+
# Run the style checks
22+
pyflakes bin tarmac setup.py
23+

tarmac/tests/test_log.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
'''Tests for tarmac.log'''
1919
import cStringIO
2020
import os
21-
import shutil
2221
import sys
2322

2423
from tarmac.tests import TarmacTestCase

tarmac/tests/test_plugin.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
import os
1717

1818
from mock import ANY, patch
19+
from operator import setitem
1920
from tarmac import plugin
2021
from tarmac import plugins as _mod_plugins
2122
from tarmac.tests import TarmacTestCase

0 commit comments

Comments
 (0)