The following issues were found

tests/internal_bench/bytealloc-1-bytes_n.py
4 issues
Unused variable 'i'
Error

Line: 5 Column: 9

              

def test(num):
    for i in iter(range(num // 1000)):
        bytes(10000)


bench.run(test)

            

Reported by Pylint.

Module name "bytealloc-1-bytes_n" doesn't conform to snake_case naming style
Error

Line: 1 Column: 1

              import bench


def test(num):
    for i in iter(range(num // 1000)):
        bytes(10000)


bench.run(test)

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              import bench


def test(num):
    for i in iter(range(num // 1000)):
        bytes(10000)


bench.run(test)

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 4 Column: 1

              import bench


def test(num):
    for i in iter(range(num // 1000)):
        bytes(10000)


bench.run(test)

            

Reported by Pylint.

tests/internal_bench/func_builtin-1-enum_pos.py
4 issues
Unused variable 'i'
Error

Line: 5 Column: 9

              

def test(num):
    for i in iter(range(num // 20)):
        enumerate([1, 2], 1)


bench.run(test)

            

Reported by Pylint.

Module name "func_builtin-1-enum_pos" doesn't conform to snake_case naming style
Error

Line: 1 Column: 1

              import bench


def test(num):
    for i in iter(range(num // 20)):
        enumerate([1, 2], 1)


bench.run(test)

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              import bench


def test(num):
    for i in iter(range(num // 20)):
        enumerate([1, 2], 1)


bench.run(test)

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 4 Column: 1

              import bench


def test(num):
    for i in iter(range(num // 20)):
        enumerate([1, 2], 1)


bench.run(test)

            

Reported by Pylint.

tests/internal_bench/func_builtin-2-enum_kw.py
4 issues
Unused variable 'i'
Error

Line: 5 Column: 9

              

def test(num):
    for i in iter(range(num // 20)):
        enumerate(iterable=[1, 2], start=1)


bench.run(test)

            

Reported by Pylint.

Module name "func_builtin-2-enum_kw" doesn't conform to snake_case naming style
Error

Line: 1 Column: 1

              import bench


def test(num):
    for i in iter(range(num // 20)):
        enumerate(iterable=[1, 2], start=1)


bench.run(test)

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              import bench


def test(num):
    for i in iter(range(num // 20)):
        enumerate(iterable=[1, 2], start=1)


bench.run(test)

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 4 Column: 1

              import bench


def test(num):
    for i in iter(range(num // 20)):
        enumerate(iterable=[1, 2], start=1)


bench.run(test)

            

Reported by Pylint.

tests/internal_bench/loop_count-1-range.py
4 issues
Unused variable 'i'
Error

Line: 5 Column: 9

              

def test(num):
    for i in range(num):
        pass


bench.run(test)

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              import bench


def test(num):
    for i in range(num):
        pass


bench.run(test)

            

Reported by Pylint.

Module name "loop_count-1-range" doesn't conform to snake_case naming style
Error

Line: 1 Column: 1

              import bench


def test(num):
    for i in range(num):
        pass


bench.run(test)

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 4 Column: 1

              import bench


def test(num):
    for i in range(num):
        pass


bench.run(test)

            

Reported by Pylint.

tests/internal_bench/loop_count-2-range_iter.py
4 issues
Unused variable 'i'
Error

Line: 5 Column: 9

              

def test(num):
    for i in iter(range(num)):
        pass


bench.run(test)

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              import bench


def test(num):
    for i in iter(range(num)):
        pass


bench.run(test)

            

Reported by Pylint.

Module name "loop_count-2-range_iter" doesn't conform to snake_case naming style
Error

Line: 1 Column: 1

              import bench


def test(num):
    for i in iter(range(num)):
        pass


bench.run(test)

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 4 Column: 1

              import bench


def test(num):
    for i in iter(range(num)):
        pass


bench.run(test)

            

Reported by Pylint.

tests/internal_bench/var-1-constant.py
4 issues
Unused argument 'num'
Error

Line: 4 Column: 10

              import bench


def test(num):
    i = 0
    while i < 20000000:
        i += 1



            

Reported by Pylint.

Module name "var-1-constant" doesn't conform to snake_case naming style
Error

Line: 1 Column: 1

              import bench


def test(num):
    i = 0
    while i < 20000000:
        i += 1



            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              import bench


def test(num):
    i = 0
    while i < 20000000:
        i += 1



            

Reported by Pylint.

Missing function or method docstring
Error

Line: 4 Column: 1

              import bench


def test(num):
    i = 0
    while i < 20000000:
        i += 1



            

Reported by Pylint.

tests/internal_bench/var-2-global.py
4 issues
Unused argument 'num'
Error

Line: 6 Column: 10

              ITERS = 20000000


def test(num):
    i = 0
    while i < ITERS:
        i += 1



            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              import bench

ITERS = 20000000


def test(num):
    i = 0
    while i < ITERS:
        i += 1

            

Reported by Pylint.

Module name "var-2-global" doesn't conform to snake_case naming style
Error

Line: 1 Column: 1

              import bench

ITERS = 20000000


def test(num):
    i = 0
    while i < ITERS:
        i += 1

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 6 Column: 1

              ITERS = 20000000


def test(num):
    i = 0
    while i < ITERS:
        i += 1



            

Reported by Pylint.

tests/io/resource_stream.py
4 issues
Unable to import 'uio'
Error

Line: 1 Column: 1

              import uio
import usys

try:
    uio.resource_stream
except AttributeError:
    print("SKIP")
    raise SystemExit


            

Reported by Pylint.

Unable to import 'usys'
Error

Line: 2 Column: 1

              import uio
import usys

try:
    uio.resource_stream
except AttributeError:
    print("SKIP")
    raise SystemExit


            

Reported by Pylint.

Consider explicitly re-raising using the 'from' keyword
Error

Line: 8 Column: 5

                  uio.resource_stream
except AttributeError:
    print("SKIP")
    raise SystemExit

buf = uio.resource_stream("data", "file2")
print(buf.read())

# resource_stream(None, ...) look ups from current dir, hence sys.path[0] hack

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              import uio
import usys

try:
    uio.resource_stream
except AttributeError:
    print("SKIP")
    raise SystemExit


            

Reported by Pylint.

tests/micropython/decorator.py
4 issues
Undefined variable 'micropython'
Error

Line: 4 Column: 2

              # test micropython-specific decorators


@micropython.bytecode
def f():
    return "bytecode"


print(f())

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              # test micropython-specific decorators


@micropython.bytecode
def f():
    return "bytecode"


print(f())

            

Reported by Pylint.

Function name "f" doesn't conform to snake_case naming style
Error

Line: 5 Column: 1

              

@micropython.bytecode
def f():
    return "bytecode"


print(f())

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 5 Column: 1

              

@micropython.bytecode
def f():
    return "bytecode"


print(f())

            

Reported by Pylint.

tests/micropython/decorator_error.py
4 issues
Use of exec detected.
Security

Line: 6
Suggestion: https://bandit.readthedocs.io/en/latest/plugins/b102_exec_used.html

              
def test_syntax(code):
    try:
        exec(code)
    except SyntaxError:
        print("SyntaxError")


# invalid micropython decorators

            

Reported by Bandit.

Use of exec
Error

Line: 6 Column: 9

              
def test_syntax(code):
    try:
        exec(code)
    except SyntaxError:
        print("SyntaxError")


# invalid micropython decorators

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              # test syntax errors for uPy-specific decorators


def test_syntax(code):
    try:
        exec(code)
    except SyntaxError:
        print("SyntaxError")


            

Reported by Pylint.

Missing function or method docstring
Error

Line: 4 Column: 1

              # test syntax errors for uPy-specific decorators


def test_syntax(code):
    try:
        exec(code)
    except SyntaxError:
        print("SyntaxError")


            

Reported by Pylint.