Skip to content

Commit 2fa1375

Browse files
committed
Remove unneeded test utilities.
1 parent 3f7b2c6 commit 2fa1375

File tree

1 file changed

+1
-41
lines changed

1 file changed

+1
-41
lines changed

pylint/testutils.py

Lines changed: 1 addition & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -344,51 +344,11 @@ def _check_result(self, got):
344344
with open(self.output, 'w') as fobj:
345345
fobj.write(got)
346346

347-
# Callback
348-
349-
def cb_test_gen(base_class):
350-
def call(input_dir, msg_dir, module_file, messages_file, dependencies):
351-
# pylint: disable=no-init
352-
class LintTC(base_class):
353-
module = module_file.replace('.py', '')
354-
output = messages_file
355-
depends = dependencies or None
356-
INPUT_DIR = input_dir
357-
MSG_DIR = msg_dir
358-
return LintTC
359-
return call
360-
361-
# Main function
362-
363-
def make_tests(input_dir, msg_dir, filter_rgx, callbacks):
364-
"""generate tests classes from test info
365-
366-
return the list of generated test classes
367-
"""
368-
if filter_rgx:
369-
is_to_run = re.compile(filter_rgx).search
370-
else:
371-
is_to_run = lambda x: 1
372-
tests = []
373-
for module_file, messages_file in (
374-
get_tests_info(input_dir, msg_dir, 'func_', '')
375-
):
376-
if not is_to_run(module_file) or module_file.endswith(('.pyc', "$py.class")):
377-
continue
378-
base = module_file.replace('func_', '').replace('.py', '')
379-
380-
dependencies = get_tests_info(input_dir, msg_dir, base, '.py')
381-
382-
for callback in callbacks:
383-
test = callback(input_dir, msg_dir, module_file, messages_file,
384-
dependencies)
385-
if test:
386-
tests.append(test)
387-
return tests
388347

389348
def tokenize_str(code):
390349
return list(tokenize.generate_tokens(StringIO(code).readline))
391350

351+
392352
@contextlib.contextmanager
393353
def create_tempfile(content=None):
394354
"""Create a new temporary file.

0 commit comments

Comments
 (0)