mirror of
https://fuchsia.googlesource.com/third_party/github.com/pylint-dev/pylint
synced 2024-09-21 16:19:21 +00:00
211d81f84f
This was changed automatically in #894, but apparently we need to have the copyright notice somewhere.
31 lines
962 B
Python
31 lines
962 B
Python
# Copyright (c) 2003-2016 LOGILAB S.A. (Paris, FRANCE).
|
|
# http://www.logilab.fr/ -- mailto:contact@logilab.fr
|
|
# 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 sys
|
|
import unittest
|
|
|
|
import astroid
|
|
|
|
from pylint.checkers import strings
|
|
from pylint.testutils import CheckerTestCase
|
|
|
|
|
|
class StringCheckerTest(CheckerTestCase):
|
|
CHECKER_CLASS = strings.StringFormatChecker
|
|
|
|
@unittest.skipUnless(sys.version_info > (3, 0),
|
|
"Tests that the string formatting checker "
|
|
"doesn't fail when encountering a bytes "
|
|
"string with a .format call")
|
|
def test_format_bytes(self):
|
|
code = "b'test'.format(1, 2)"
|
|
node = astroid.extract_node(code)
|
|
with self.assertNoMessages():
|
|
self.checker.visit_call(node)
|
|
|
|
|
|
if __name__ == '__main__':
|
|
unittest.main()
|