The following issues were found

tests/pyb/pyb1.py
2 issues
Unable to import 'pyb'
Error

Line: 3 Column: 1

              # basic tests of pyb module

import pyb

# test delay

pyb.delay(-1)
pyb.delay(0)
pyb.delay(1)

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              # basic tests of pyb module

import pyb

# test delay

pyb.delay(-1)
pyb.delay(0)
pyb.delay(1)

            

Reported by Pylint.

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

Line: 15 Column: 5

                  t.name
except AttributeError:
    print("SKIP")
    raise SystemExit


# test printing of attrtuple
print(str(t).find("version=") > 0)


            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              # test attrtuple
# we can't test this type directly so we use sys.implementation object

try:
    import usys as sys
except ImportError:
    import sys
t = sys.implementation


            

Reported by Pylint.

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

Line: 10 Column: 9

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

print(json.loads(b"[1,2]"))
print(json.loads(bytearray(b"[null]")))

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              # test loading from bytes and bytearray (introduced in Python 3.6)

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

            

Reported by Pylint.

tests/pyb/servo.py
2 issues
Unable to import 'pyb'
Error

Line: 1 Column: 1

              from pyb import Servo

servo = Servo(1)
print(servo)

servo.angle(0)
servo.angle(10, 100)

servo.speed(-10)

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              from pyb import Servo

servo = Servo(1)
print(servo)

servo.angle(0)
servo.angle(10, 100)

servo.speed(-10)

            

Reported by Pylint.

tests/pyb/spi.py
2 issues
Unable to import 'pyb'
Error

Line: 1 Column: 1

              from pyb import SPI

# test we can correctly create by id
for bus in (-1, 0, 1, 2):
    try:
        SPI(bus)
        print("SPI", bus)
    except ValueError:
        print("ValueError", bus)

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              from pyb import SPI

# test we can correctly create by id
for bus in (-1, 0, 1, 2):
    try:
        SPI(bus)
        print("SPI", bus)
    except ValueError:
        print("ValueError", bus)

            

Reported by Pylint.

tests/pyb/switch.py
2 issues
Unable to import 'pyb'
Error

Line: 1 Column: 1

              from pyb import Switch

sw = Switch()
print(sw())
sw.callback(print)
sw.callback(None)

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              from pyb import Switch

sw = Switch()
print(sw())
sw.callback(print)
sw.callback(None)

            

Reported by Pylint.

tests/feature_check/complex.py
2 issues
Statement seems to have no effect
Error

Line: 2 Column: 5

              try:
    complex
    print("complex")
except NameError:
    print("no")

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              try:
    complex
    print("complex")
except NameError:
    print("no")

            

Reported by Pylint.

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

Line: 1 Column: 1

              d = {}
print(d.setdefault(1))
print(d.setdefault(1))
print(d.setdefault(5, 42))
print(d.setdefault(5, 1))
print(d[1])
print(d[5])
d.pop(5)
print(d.setdefault(5, 1))

            

Reported by Pylint.

Trailing newlines
Error

Line: 13 Column: 1

              print(d[1])
print(d[5])



            

Reported by Pylint.

tests/pyb/uart.py
2 issues
Unable to import 'pyb'
Error

Line: 1 Column: 1

              from pyb import UART

# test we can correctly create by id
for bus in (-1, 0, 1, 2, 5, 6):
    try:
        UART(bus, 9600)
        print("UART", bus)
    except ValueError:
        print("ValueError", bus)

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              from pyb import UART

# test we can correctly create by id
for bus in (-1, 0, 1, 2, 5, 6):
    try:
        UART(bus, 9600)
        print("UART", bus)
    except ValueError:
        print("ValueError", bus)

            

Reported by Pylint.

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

Line: 1 Column: 1

              els = []
d = {1:2,3:4}
a = d.popitem()
print(len(d))
els.append(a)
a = d.popitem()
print(len(d))
els.append(a)
try:

            

Reported by Pylint.

Trailing newlines
Error

Line: 16 Column: 1

              else:
    print("Did not raise KeyError")
print(sorted(els))


            

Reported by Pylint.