예제 #1
0
def test_print_statement():
  ps = PrintStatements(PythonFile.from_statement("""
    print["I do what I want"]
  """))
  nits = list(ps.nits())
  assert len(nits) == 1
  assert nits[0].code == 'T607'
  assert nits[0].severity == Nit.ERROR
예제 #2
0
def test_print_statement():
    ps = PrintStatements(
        PythonFile.from_statement("""
    print["I do what I want"]
  """))
    nits = list(ps.nits())
    assert len(nits) == 1
    assert nits[0].code == 'T607'
    assert nits[0].severity == Nit.ERROR
예제 #3
0
def test_print_override():
  ps = PrintStatements(PythonFile.from_statement("""
    from __future__ import print_function
    print("I do what I want")
    
    class Foo(object):
      def print(self):
        "I can do this because it's not a reserved word."
  """))
  assert len(list(ps.nits())) == 0
예제 #4
0
def test_print_override():
    ps = PrintStatements(
        PythonFile.from_statement("""
    from __future__ import print_function
    print("I do what I want")
    
    class Foo(object):
      def print(self):
        "I can do this because it's not a reserved word."
  """))
    assert len(list(ps.nits())) == 0
예제 #5
0
def test_print_function():
  ps = PrintStatements(PythonFile.from_statement("""
    print("I do what I want")
  """))
  assert len(list(ps.nits())) == 0
예제 #6
0
def test_print_function():
    ps = PrintStatements(
        PythonFile.from_statement("""
    print("I do what I want")
  """))
    assert len(list(ps.nits())) == 0