Allow latest release of black to run
This commit is contained in:
parent
6c6e58152c
commit
fa80f7d2ef
4 changed files with 15 additions and 9 deletions
2
.github/workflows/build.yml
vendored
2
.github/workflows/build.yml
vendored
|
|
@ -35,7 +35,7 @@ jobs:
|
||||||
source actions-ci/install.sh
|
source actions-ci/install.sh
|
||||||
- name: Pip install pylint, black, & Sphinx
|
- name: Pip install pylint, black, & Sphinx
|
||||||
run: |
|
run: |
|
||||||
pip install --force-reinstall pylint black==19.10b0 Sphinx sphinx-rtd-theme
|
pip install --force-reinstall pylint black Sphinx sphinx-rtd-theme
|
||||||
- name: Library version
|
- name: Library version
|
||||||
run: git describe --dirty --always --tags
|
run: git describe --dirty --always --tags
|
||||||
- name: Check formatting
|
- name: Check formatting
|
||||||
|
|
|
||||||
|
|
@ -8,8 +8,8 @@
|
||||||
|
|
||||||
class Enum:
|
class Enum:
|
||||||
"""
|
"""
|
||||||
Object supporting CircuitPython-style of static symbols
|
Object supporting CircuitPython-style of static symbols
|
||||||
as seen with Direction.OUTPUT, Pull.UP
|
as seen with Direction.OUTPUT, Pull.UP
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
|
|
@ -27,8 +27,8 @@ class Enum:
|
||||||
@classmethod
|
@classmethod
|
||||||
def iteritems(cls):
|
def iteritems(cls):
|
||||||
"""
|
"""
|
||||||
Inspects attributes of the class for instances of the class
|
Inspects attributes of the class for instances of the class
|
||||||
and returns as key,value pairs mirroring dict#iteritems
|
and returns as key,value pairs mirroring dict#iteritems
|
||||||
"""
|
"""
|
||||||
for key in dir(cls):
|
for key in dir(cls):
|
||||||
val = getattr(cls, key)
|
val = getattr(cls, key)
|
||||||
|
|
|
||||||
|
|
@ -127,7 +127,7 @@ class I2C(Lockable):
|
||||||
in_end=None,
|
in_end=None,
|
||||||
stop=False
|
stop=False
|
||||||
):
|
):
|
||||||
""""Write to a device at specified address from a buffer then read
|
""" "Write to a device at specified address from a buffer then read
|
||||||
from a device at specified address into a buffer
|
from a device at specified address into a buffer
|
||||||
"""
|
"""
|
||||||
return self._i2c.writeto_then_readfrom(
|
return self._i2c.writeto_then_readfrom(
|
||||||
|
|
|
||||||
|
|
@ -3,8 +3,8 @@ import unittest
|
||||||
|
|
||||||
class TestEnum(unittest.TestCase):
|
class TestEnum(unittest.TestCase):
|
||||||
"""
|
"""
|
||||||
Verifies the repl() and str() behaviour of an example Enum
|
Verifies the repl() and str() behaviour of an example Enum
|
||||||
Enums represent configuration values such as digitalio.Direction, digitalio.Pull etc.
|
Enums represent configuration values such as digitalio.Direction, digitalio.Pull etc.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
|
|
@ -24,7 +24,13 @@ class TestEnum(unittest.TestCase):
|
||||||
def test_iteritems(self):
|
def test_iteritems(self):
|
||||||
"""A subtype of Enum can list all attributes of its own type"""
|
"""A subtype of Enum can list all attributes of its own type"""
|
||||||
items = list(self.Cls.iteritems())
|
items = list(self.Cls.iteritems())
|
||||||
self.assertEqual(items, [("one", self.Cls.one), ("two", self.Cls.two),])
|
self.assertEqual(
|
||||||
|
items,
|
||||||
|
[
|
||||||
|
("one", self.Cls.one),
|
||||||
|
("two", self.Cls.two),
|
||||||
|
],
|
||||||
|
)
|
||||||
|
|
||||||
def test_repr(self):
|
def test_repr(self):
|
||||||
"""A repr() call on an Enum gives its fully-qualified name"""
|
"""A repr() call on an Enum gives its fully-qualified name"""
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue