Skip to content

Commit d3df39d

Browse files
authored
Merge pull request #14 from tannewt/move_tests
Move tests so that they don't get bundled
2 parents 74b287c + fd45cdc commit d3df39d

9 files changed

+8
-15
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ install:
2727
- pip install --force-reinstall pylint==1.9.2
2828

2929
script:
30-
- pytest adafruit_imageload
30+
- python -m pytest
3131
- pylint adafruit_imageload/**
3232
- ([[ ! -d "examples" ]] || pylint --disable=missing-docstring,invalid-name,bad-whitespace examples/*.py)
3333
- circuitpython-build-bundles --filename_prefix adafruit-circuitpython-imageload --library_location .
File renamed without changes.

adafruit_imageload/tests/test_bmp_indexed_load.py renamed to tests/test_bmp_indexed_load.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,14 @@
2929

3030
import os
3131
from unittest import TestCase
32-
from .. import load
32+
from adafruit_imageload import load
3333
from .displayio_shared_bindings import Bitmap_C_Interface, Palette_C_Interface
3434

3535

3636
class TestBmpIndexedLoad(TestCase):
3737
def test_order_bgra_to_rgba(self):
3838
test_file = os.path.join(
39-
os.path.dirname(__file__), "..", "..", "examples", "images", "4bit.bmp"
39+
os.path.dirname(__file__), "..", "examples", "images", "4bit.bmp"
4040
)
4141

4242
bitmap, palette = load(

adafruit_imageload/tests/test_pbm_load.py renamed to tests/test_pbm_load.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@
2929
import os
3030
from io import BytesIO
3131
from unittest import TestCase
32-
from .. import pnm
33-
from ..pnm.pbm_binary import iterbits, reverse
32+
from adafruit_imageload import pnm
33+
from adafruit_imageload.pnm.pbm_binary import iterbits, reverse
3434
from .displayio_shared_bindings import Bitmap_C_Interface, Palette_C_Interface
3535

3636

@@ -50,7 +50,6 @@ def test_load_works_p1_ascii(self):
5050
test_file = os.path.join(
5151
os.path.dirname(__file__),
5252
"..",
53-
"..",
5453
"examples",
5554
"images",
5655
"netpbm_p1_mono_ascii.pbm",
@@ -86,7 +85,6 @@ def test_load_works_p4_binary(self):
8685
test_file = os.path.join(
8786
os.path.dirname(__file__),
8887
"..",
89-
"..",
9088
"examples",
9189
"images",
9290
"netpbm_p4_mono_binary.pbm",
@@ -108,7 +106,6 @@ def test_load_works_p4_binary_high_res(self):
108106
test_file = os.path.join(
109107
os.path.dirname(__file__),
110108
"..",
111-
"..",
112109
"examples",
113110
"images",
114111
"netpbm_p4_mono_large.pbm",

adafruit_imageload/tests/test_pgm_load.py renamed to tests/test_pgm_load.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
"""
2929
import os
3030
from unittest import TestCase
31-
from .. import pnm
31+
from adafruit_imageload import pnm
3232
from .displayio_shared_bindings import Bitmap_C_Interface, Palette_C_Interface
3333

3434

@@ -37,7 +37,6 @@ def test_load_works_p2_ascii(self):
3737
test_file = os.path.join(
3838
os.path.dirname(__file__),
3939
"..",
40-
"..",
4140
"examples",
4241
"images",
4342
"netpbm_p2_ascii.pgm",
@@ -59,7 +58,6 @@ def test_load_works_p5_binary(self):
5958
test_file = os.path.join(
6059
os.path.dirname(__file__),
6160
"..",
62-
"..",
6361
"examples",
6462
"images",
6563
"netpbm_p5_binary.pgm",

adafruit_imageload/tests/test_ppm_load.py renamed to tests/test_ppm_load.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@
2929
import os
3030
from io import BytesIO
3131
from unittest import TestCase
32-
from .. import pnm
33-
from ..pnm.ppm_ascii import read_three_colors
32+
from adafruit_imageload import pnm
33+
from adafruit_imageload.pnm.ppm_ascii import read_three_colors
3434
from .displayio_shared_bindings import Bitmap_C_Interface, Palette_C_Interface
3535

3636

@@ -39,7 +39,6 @@ def test_load_works_p3_ascii(self):
3939
test_file = os.path.join(
4040
os.path.dirname(__file__),
4141
"..",
42-
"..",
4342
"examples",
4443
"images",
4544
"netpbm_p3_rgb_ascii.ppm",
@@ -63,7 +62,6 @@ def test_load_works_p6_binary(self):
6362
test_file = os.path.join(
6463
os.path.dirname(__file__),
6564
"..",
66-
"..",
6765
"examples",
6866
"images",
6967
"netpbm_p6_binary.ppm",

0 commit comments

Comments
 (0)