The following issues were found

tests/extmod/ujson_loads_float.py
4 issues
Consider explicitly re-raising using the 'from' keyword
Error

Line: 8 Column: 9

                      import json
    except ImportError:
        print("SKIP")
        raise SystemExit


def my_print(o):
    print("%.3f" % o)


            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              try:
    import ujson as json
except ImportError:
    try:
        import json
    except ImportError:
        print("SKIP")
        raise SystemExit


            

Reported by Pylint.

Argument name "o" doesn't conform to snake_case naming style
Error

Line: 11 Column: 1

                      raise SystemExit


def my_print(o):
    print("%.3f" % o)


my_print(json.loads("1.2"))
my_print(json.loads("1e2"))

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 11 Column: 1

                      raise SystemExit


def my_print(o):
    print("%.3f" % o)


my_print(json.loads("1.2"))
my_print(json.loads("1e2"))

            

Reported by Pylint.

tests/extmod/urandom_seed_default.py
4 issues
Consider explicitly re-raising using the 'from' keyword
Error

Line: 10 Column: 9

                      import random
    except ImportError:
        print("SKIP")
        raise SystemExit

try:
    random.seed()
except ValueError:
    # no default seed on this platform

            

Reported by Pylint.

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

Line: 17 Column: 5

              except ValueError:
    # no default seed on this platform
    print("SKIP")
    raise SystemExit


def rng_seq():
    return [random.getrandbits(16) for _ in range(10)]


            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              # test urandom.seed() without any arguments

try:
    import urandom as random
except ImportError:
    try:
        import random
    except ImportError:
        print("SKIP")

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 20 Column: 1

                  raise SystemExit


def rng_seq():
    return [random.getrandbits(16) for _ in range(10)]


# seed with default and check that doesn't produce the same RNG sequence
random.seed()

            

Reported by Pylint.

tests/extmod/ure_debug.py
4 issues
Statement seems to have no effect
Error

Line: 5 Column: 5

              try:
    import ure

    ure.DEBUG
except (ImportError, AttributeError):
    print("SKIP")
    raise SystemExit

ure.compile("^a|b[0-9]\w$", ure.DEBUG)

            

Reported by Pylint.

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

Line: 8 Column: 5

                  ure.DEBUG
except (ImportError, AttributeError):
    print("SKIP")
    raise SystemExit

ure.compile("^a|b[0-9]\w$", ure.DEBUG)

            

Reported by Pylint.

Anomalous backslash in string: '\w'. String constant might be missing an r prefix.
Error

Line: 10 Column: 23

                  print("SKIP")
    raise SystemExit

ure.compile("^a|b[0-9]\w$", ure.DEBUG)

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              # test printing debugging info when compiling
try:
    import ure

    ure.DEBUG
except (ImportError, AttributeError):
    print("SKIP")
    raise SystemExit


            

Reported by Pylint.

tests/extmod/ure_groups.py
4 issues
Consider explicitly re-raising using the 'from' keyword
Error

Line: 10 Column: 9

                      import re
    except ImportError:
        print("SKIP")
        raise SystemExit

try:
    m = re.match(".", "a")
    m.groups
except AttributeError:

            

Reported by Pylint.

Statement seems to have no effect
Error

Line: 14 Column: 5

              
try:
    m = re.match(".", "a")
    m.groups
except AttributeError:
    print("SKIP")
    raise SystemExit



            

Reported by Pylint.

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

Line: 17 Column: 5

                  m.groups
except AttributeError:
    print("SKIP")
    raise SystemExit


m = re.match(r"(([0-9]*)([a-z]*)[0-9]*)", "1234hello567")
print(m.groups())


            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              # test match.groups()

try:
    import ure as re
except ImportError:
    try:
        import re
    except ImportError:
        print("SKIP")

            

Reported by Pylint.

tests/extmod/ure_namedclass.py
4 issues
Consider explicitly re-raising using the 'from' keyword
Error

Line: 10 Column: 9

                      import re
    except ImportError:
        print("SKIP")
        raise SystemExit


def print_groups(match):
    print("----")
    try:

            

Reported by Pylint.

Unused argument 'match'
Error

Line: 13 Column: 18

                      raise SystemExit


def print_groups(match):
    print("----")
    try:
        i = 0
        while True:
            print(m.group(i))

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              # test named char classes

try:
    import ure as re
except ImportError:
    try:
        import re
    except ImportError:
        print("SKIP")

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 13 Column: 1

                      raise SystemExit


def print_groups(match):
    print("----")
    try:
        i = 0
        while True:
            print(m.group(i))

            

Reported by Pylint.

tests/extmod/utime_time_ns.py
4 issues
Statement seems to have no effect
Error

Line: 6 Column: 5

              try:
    import utime

    utime.sleep_us
    utime.time_ns
except (ImportError, AttributeError):
    print("SKIP")
    raise SystemExit


            

Reported by Pylint.

Statement seems to have no effect
Error

Line: 7 Column: 5

                  import utime

    utime.sleep_us
    utime.time_ns
except (ImportError, AttributeError):
    print("SKIP")
    raise SystemExit



            

Reported by Pylint.

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

Line: 10 Column: 5

                  utime.time_ns
except (ImportError, AttributeError):
    print("SKIP")
    raise SystemExit


t0 = utime.time_ns()
utime.sleep_us(5000)
t1 = utime.time_ns()

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              # test utime.time_ns()

try:
    import utime

    utime.sleep_us
    utime.time_ns
except (ImportError, AttributeError):
    print("SKIP")

            

Reported by Pylint.

tests/extmod/utimeq_stable.py
4 issues
Consider explicitly re-raising using the 'from' keyword
Error

Line: 5 Column: 5

                  from utimeq import utimeq
except ImportError:
    print("SKIP")
    raise SystemExit

h = utimeq(10)

# Check that for 2 same-key items, the queue is stable (pops items
# in the same order they were pushed). Unfortunately, this no longer

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              try:
    from utimeq import utimeq
except ImportError:
    print("SKIP")
    raise SystemExit

h = utimeq(10)

# Check that for 2 same-key items, the queue is stable (pops items

            

Reported by Pylint.

Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.
Security

Line: 18
Suggestion: https://bandit.readthedocs.io/en/latest/plugins/b101_assert_used.html

              
res = [0, 0, 0]
h.pop(res)
assert res == [100, 20, 0]
h.pop(res)
assert res == [100, 10, 0]

print("OK")

            

Reported by Bandit.

Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.
Security

Line: 20
Suggestion: https://bandit.readthedocs.io/en/latest/plugins/b101_assert_used.html

              h.pop(res)
assert res == [100, 20, 0]
h.pop(res)
assert res == [100, 10, 0]

print("OK")

            

Reported by Bandit.

tests/extmod/vfs_posix.py
4 issues
Statement seems to have no effect
Error

Line: 6 Column: 5

              try:
    import uos

    uos.VfsPosix
except (ImportError, AttributeError):
    print("SKIP")
    raise SystemExit

# We need a directory for testing that doesn't already exist.

            

Reported by Pylint.

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

Line: 9 Column: 5

                  uos.VfsPosix
except (ImportError, AttributeError):
    print("SKIP")
    raise SystemExit

# We need a directory for testing that doesn't already exist.
# Skip the test if it does exist.
temp_dir = "micropy_test_dir"
try:

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              # Test for VfsPosix

try:
    import uos

    uos.VfsPosix
except (ImportError, AttributeError):
    print("SKIP")
    raise SystemExit

            

Reported by Pylint.

Constant name "temp_dir" doesn't conform to UPPER_CASE naming style
Error

Line: 13 Column: 1

              
# We need a directory for testing that doesn't already exist.
# Skip the test if it does exist.
temp_dir = "micropy_test_dir"
try:
    uos.stat(temp_dir)
    print("SKIP")
    raise SystemExit
except OSError:

            

Reported by Pylint.

tests/feature_check/native_check.py
4 issues
Undefined variable 'micropython'
Error

Line: 2 Column: 2

              # this test for the availability of native emitter
@micropython.native
def f():
    pass


f()
print("native")

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              # this test for the availability of native emitter
@micropython.native
def f():
    pass


f()
print("native")

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 3 Column: 1

              # this test for the availability of native emitter
@micropython.native
def f():
    pass


f()
print("native")

            

Reported by Pylint.

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

Line: 3 Column: 1

              # this test for the availability of native emitter
@micropython.native
def f():
    pass


f()
print("native")

            

Reported by Pylint.

tests/float/builtin_float_minmax.py
4 issues
Statement seems to have no effect
Error

Line: 3 Column: 5

              # test builtin min and max functions with float args
try:
    min
    max
except:
    print("SKIP")
    raise SystemExit

print(min(0, 1.0))

            

Reported by Pylint.

Statement seems to have no effect
Error

Line: 4 Column: 5

              # test builtin min and max functions with float args
try:
    min
    max
except:
    print("SKIP")
    raise SystemExit

print(min(0, 1.0))

            

Reported by Pylint.

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

Line: 7 Column: 5

                  max
except:
    print("SKIP")
    raise SystemExit

print(min(0, 1.0))
print(min(1.0, 0))
print(min(0, -1.0))
print(min(-1.0, 0))

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              # test builtin min and max functions with float args
try:
    min
    max
except:
    print("SKIP")
    raise SystemExit

print(min(0, 1.0))

            

Reported by Pylint.