third_party.pylibs.pylint.src/pylint/test/unittest_checker_strings.py

21 lines
654 B
Python
Raw Normal View History

2018-07-15 09:36:36 +00:00
# Copyright (c) 2015-2018 Claudiu Popa <pcmanticore@gmail.com>
2017-12-15 11:24:15 +00:00
# Copyright (c) 2016 Derek Gustafson <degustaf@gmail.com>
# Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html
# For details: https://github.com/PyCQA/pylint/blob/master/COPYING
import astroid
from pylint.checkers import strings
from pylint.testutils import CheckerTestCase
2016-12-06 15:42:53 +00:00
class TestStringChecker(CheckerTestCase):
CHECKER_CLASS = strings.StringFormatChecker
def test_format_bytes(self):
code = "b'test'.format(1, 2)"
node = astroid.extract_node(code)
with self.assertNoMessages():
self.checker.visit_call(node)