-
Notifications
You must be signed in to change notification settings - Fork 2
/
tube.py
35 lines (33 loc) · 1.22 KB
/
tube.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
from testtube.helpers import Nosetests, Pep257, Flake8, ClearScreen
# Don't process any file changes that match these rules
IGNORE_PATTERNS = (
# The integration tests changes .py files in this directory. If we don't
# ignore them, testtube will see these changes and loop forever.
r'.*sample/[^/]*$',
)
PATTERNS = (
# Clear the last set of test results because we're about to have more
(
r'(.*setup\.cfg$)|(.*\.coveragerc)|(.*\.py$)', [ClearScreen()],
),
# Run pep257 check against a file if it changes, excluding files that have
# tests/ or tube.py in the name.
# If this test fails, don't make any noise (0 bells on failure)
(
r'((?!tests/)(?!tube\.py).)*\.py$',
[Pep257(bells=0)]
),
# Run flake8 on all python files when they change. If this checks fails,
# abort the entire test suite because it might be due to a syntax error.
# There's no point running the subsequent tests if there is such an error.
(
r'.*\.py$',
[Flake8(all_files=True)],
{'fail_fast': True}
),
# Run the test suite whenever python or test config files change
(
r'(.*setup\.cfg$)|(.*\.coveragerc)|(.*\.py$)',
[Nosetests()]
)
)