-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathtest_func.py
29 lines (19 loc) · 927 Bytes
/
test_func.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
from os.path import join, dirname, abspath
import unittest
from pylint.testutils import make_tests, LintTestUsingModule, LintTestUsingFile, cb_test_gen, linter
import sys
INPUT_DIR = join(dirname(abspath(__file__)), 'input')
MESSAGES_DIR = join(dirname(abspath(__file__)), 'messages')
CALLBACKS = [cb_test_gen(LintTestUsingModule), cb_test_gen(LintTestUsingFile)]
FILTER_RGX = None
linter.load_plugin_modules(['pylint_celery'])
linter.global_set_option('required-attributes', ()) # remove required __revision__
def suite():
return unittest.TestSuite([unittest.makeSuite(test, suiteClass=unittest.TestSuite)
for test in make_tests(INPUT_DIR, MESSAGES_DIR,
FILTER_RGX, CALLBACKS)])
if __name__=='__main__':
if len(sys.argv) > 1:
FILTER_RGX = sys.argv[1]
del sys.argv[1]
unittest.main(defaultTest='suite')