The following issues were found

tests/basics/string_partition.py
2 issues
Consider explicitly re-raising using the 'from' keyword
Error

Line: 5 Column: 5

                  str.partition
except AttributeError:
    print("SKIP")
    raise SystemExit

print("asdf".partition('g'))
print("asdf".partition('a'))
print("asdf".partition('s'))
print("asdf".partition('f'))

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              try:
    str.partition
except AttributeError:
    print("SKIP")
    raise SystemExit

print("asdf".partition('g'))
print("asdf".partition('a'))
print("asdf".partition('s'))

            

Reported by Pylint.

tests/basics/try_as_var.py
2 issues
Missing module docstring
Error

Line: 1 Column: 1

              try:
    raise ValueError(534)
except ValueError as e:
    print(type(e), e.args)

# Var bound in except block is automatically deleted
try:
    e
except NameError:

            

Reported by Pylint.

Variable name "e" doesn't conform to snake_case naming style
Error

Line: 3 Column: 1

              try:
    raise ValueError(534)
except ValueError as e:
    print(type(e), e.args)

# Var bound in except block is automatically deleted
try:
    e
except NameError:

            

Reported by Pylint.

tests/basics/array_construct_endian.py
2 issues
Consider explicitly re-raising using the 'from' keyword
Error

Line: 10 Column: 9

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

# raw copy from bytes, bytearray
print(array('h', b'12'))

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              # test construction of array.array from different objects

try:
    from uarray import array
except ImportError:
    try:
        from array import array
    except ImportError:
        print("SKIP")

            

Reported by Pylint.

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

Line: 5 Column: 5

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

desc = {
    "f32": uctypes.FLOAT32 | 0,
    "f64": uctypes.FLOAT64 | 0,
    "uf64": uctypes.FLOAT64 | 2,  # unaligned

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

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

desc = {
    "f32": uctypes.FLOAT32 | 0,
    "f64": uctypes.FLOAT64 | 0,

            

Reported by Pylint.

tests/io/file_with.py
2 issues
No exception type(s) specified
Error

Line: 9 Column: 1

              # File should be closed
try:
    f.read()
except:
    # Note: CPython and us throw different exception trying to read from
    # close file.
    print("can't read file after with")



            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              f = open("io/data/file1")

with f as f2:
    print(f2.read())

# File should be closed
try:
    f.read()
except:

            

Reported by Pylint.

tests/basics/string_strip.py
2 issues
Missing module docstring
Error

Line: 1 Column: 1

              print("".strip())
print(" \t\n\r\v\f".strip())
print(" T E S T".strip())
print("abcabc".strip("ce"))
print("aaa".strip("b"))
print("abc  efg ".strip("g a"))

print('   spacious   '.lstrip())
print('www.example.com'.lstrip('cmowz.'))

            

Reported by Pylint.

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

Line: 43 Column: 1

              print("\0abc\0".strip("\0"))

# Test that stripping unstrippable string returns original object
s = "abc"
print(id(s.strip()) == id(s))

            

Reported by Pylint.

tests/io/open_plus.py
2 issues
Unnecessary pass statement
Error

Line: 21 Column: 5

                  print("Unexpectedly opened non-existing file")
except OSError:
    print("Expected OSError")
    pass

f = open("testfile", "w+b")
f.write(b"1234567890")
f.seek(0)
print(f.read())

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              try:
    import uos as os
except ImportError:
    import os

if not hasattr(os, "remove"):
    print("SKIP")
    raise SystemExit


            

Reported by Pylint.

tests/basics/bytes_add_array.py
2 issues
Consider explicitly re-raising using the 'from' keyword
Error

Line: 9 Column: 9

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

# should be byteorder-neutral
print(b"123" + array.array('h', [0x1515]))

print(b"\x01\x02" + array.array('b', [1, 2]))

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              # test bytes + other
try:
    import uarray as array
except ImportError:
    try:
        import array
    except ImportError:
        print("SKIP")
        raise SystemExit

            

Reported by Pylint.

tests/basics/module2.py
2 issues
Unable to import 'usys'
Error

Line: 2 Column: 1

              # uPy behaviour only: builtin modules are read-only
import usys
try:
    usys.x = 1
except AttributeError:
    print("AttributeError")

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              # uPy behaviour only: builtin modules are read-only
import usys
try:
    usys.x = 1
except AttributeError:
    print("AttributeError")

            

Reported by Pylint.

tests/float/list_index.py
2 issues
Sequence index is not an int, slice, or instance with __index__
Error

Line: 6 Column: 11

              print(x[1])

try:
    print(x[1.0])
except TypeError:
    print("TypeError")

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              x = [1, 2]

print(x[1])

try:
    print(x[1.0])
except TypeError:
    print("TypeError")

            

Reported by Pylint.