forked from tmux-python/tmuxp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscent.py
34 lines (25 loc) · 852 Bytes
/
scent.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
from __future__ import unicode_literals
import os
import termstyle
from sniffer.api import file_validator, runnable
from tmuxp.testsuite import main
# you can customize the pass/fail colors like this
pass_fg_color = termstyle.green
pass_bg_color = termstyle.bg_default
fail_fg_color = termstyle.red
fail_bg_color = termstyle.bg_default
# All lists in this variable will be under surveillance for changes.
watch_paths = ['tmuxp/']
@file_validator
def py_files(filename):
return filename.endswith('.py') and not os.path.basename(filename).startswith('.') and filename != ".tmuxp"
@runnable
def execute_nose(*args):
try:
return main()
except SystemExit as x:
if hasattr(x, 'message'):
print("Found error {0}: {1}".format(x.code, x.message))
return not x.code
else:
return 1