Skip to content

Commit 32f1768

Browse files
authored
Merge pull request #38 from tannewt/run_tests
Run tests in Actions
2 parents 4aa1c1c + 2a317a2 commit 32f1768

File tree

2 files changed

+27
-2
lines changed

2 files changed

+27
-2
lines changed

.github/workflows/test.yml

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Run Tests
2+
3+
on: [pull_request, push]
4+
5+
jobs:
6+
test:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- name: Set up Python 3.6
10+
uses: actions/setup-python@v1
11+
with:
12+
python-version: 3.6
13+
- name: Versions
14+
run: |
15+
python3 --version
16+
- name: Checkout Current Repo
17+
uses: actions/checkout@v1
18+
with:
19+
submodules: true
20+
- name: Install pytest
21+
run: pip install pytest
22+
- name: Install locally
23+
run: pip install .
24+
- name: Run tests
25+
run: pytest

adafruit_imageload/bmp/__init__.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,10 @@ def load(file, *, bitmap=None, palette=None):
5252
width = int.from_bytes(file.read(4), "little")
5353
try:
5454
height = int.from_bytes(file.read(4), "little")
55-
except OverflowError:
55+
except OverflowError as error:
5656
raise NotImplementedError(
5757
"Negative height BMP files are not supported on builds without longint"
58-
)
58+
) from error
5959
file.seek(0x1C) # Number of bits per pixel
6060
color_depth = int.from_bytes(file.read(2), "little")
6161
file.seek(0x1E) # Compression type

0 commit comments

Comments
 (0)