From 0bfd332e33ba0351494382b3089de375fc291b44 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Fri, 28 Aug 2020 12:28:26 -0700 Subject: [PATCH 1/2] Run tests in Actions --- .github/workflows/test.yml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..2f9163b --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,25 @@ +name: Run Tests + +on: [pull_request, push] + +jobs: + test: + runs-on: ubuntu-latest + steps: + - name: Set up Python 3.6 + uses: actions/setup-python@v1 + with: + python-version: 3.6 + - name: Versions + run: | + python3 --version + - name: Checkout Current Repo + uses: actions/checkout@v1 + with: + submodules: true + - name: Install pytest + run: pip install pytest + - name: Install locally + run: pip install . + - name: Run tests + run: pytest From 2a317a246b02dc59011c775a672f1b90c40ee8cd Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Fri, 28 Aug 2020 12:32:51 -0700 Subject: [PATCH 2/2] Lint --- adafruit_imageload/bmp/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/adafruit_imageload/bmp/__init__.py b/adafruit_imageload/bmp/__init__.py index 4eb9167..4136af8 100644 --- a/adafruit_imageload/bmp/__init__.py +++ b/adafruit_imageload/bmp/__init__.py @@ -52,10 +52,10 @@ def load(file, *, bitmap=None, palette=None): width = int.from_bytes(file.read(4), "little") try: height = int.from_bytes(file.read(4), "little") - except OverflowError: + except OverflowError as error: raise NotImplementedError( "Negative height BMP files are not supported on builds without longint" - ) + ) from error file.seek(0x1C) # Number of bits per pixel color_depth = int.from_bytes(file.read(2), "little") file.seek(0x1E) # Compression type