diff --git a/.travis.yml b/.travis.yml index 65e9d67..8eab8e4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -27,7 +27,7 @@ install: - pip install --force-reinstall pylint==1.9.2 script: - - pytest adafruit_imageload + - python -m pytest - pylint adafruit_imageload/** - ([[ ! -d "examples" ]] || pylint --disable=missing-docstring,invalid-name,bad-whitespace examples/*.py) - circuitpython-build-bundles --filename_prefix adafruit-circuitpython-imageload --library_location . diff --git a/adafruit_imageload/tests/__init__.py b/tests/__init__.py similarity index 100% rename from adafruit_imageload/tests/__init__.py rename to tests/__init__.py diff --git a/adafruit_imageload/tests/displayio_shared_bindings.py b/tests/displayio_shared_bindings.py similarity index 100% rename from adafruit_imageload/tests/displayio_shared_bindings.py rename to tests/displayio_shared_bindings.py diff --git a/adafruit_imageload/tests/test_bitmap_c_interface.py b/tests/test_bitmap_c_interface.py similarity index 100% rename from adafruit_imageload/tests/test_bitmap_c_interface.py rename to tests/test_bitmap_c_interface.py diff --git a/adafruit_imageload/tests/test_bmp_indexed_load.py b/tests/test_bmp_indexed_load.py similarity index 95% rename from adafruit_imageload/tests/test_bmp_indexed_load.py rename to tests/test_bmp_indexed_load.py index 53d1544..c0bb5eb 100644 --- a/adafruit_imageload/tests/test_bmp_indexed_load.py +++ b/tests/test_bmp_indexed_load.py @@ -29,14 +29,14 @@ import os from unittest import TestCase -from .. import load +from adafruit_imageload import load from .displayio_shared_bindings import Bitmap_C_Interface, Palette_C_Interface class TestBmpIndexedLoad(TestCase): def test_order_bgra_to_rgba(self): test_file = os.path.join( - os.path.dirname(__file__), "..", "..", "examples", "images", "4bit.bmp" + os.path.dirname(__file__), "..", "examples", "images", "4bit.bmp" ) bitmap, palette = load( diff --git a/adafruit_imageload/tests/test_palette_c_interface.py b/tests/test_palette_c_interface.py similarity index 100% rename from adafruit_imageload/tests/test_palette_c_interface.py rename to tests/test_palette_c_interface.py diff --git a/adafruit_imageload/tests/test_pbm_load.py b/tests/test_pbm_load.py similarity index 97% rename from adafruit_imageload/tests/test_pbm_load.py rename to tests/test_pbm_load.py index 4dd9edf..b7f8bb9 100644 --- a/adafruit_imageload/tests/test_pbm_load.py +++ b/tests/test_pbm_load.py @@ -29,8 +29,8 @@ import os from io import BytesIO from unittest import TestCase -from .. import pnm -from ..pnm.pbm_binary import iterbits, reverse +from adafruit_imageload import pnm +from adafruit_imageload.pnm.pbm_binary import iterbits, reverse from .displayio_shared_bindings import Bitmap_C_Interface, Palette_C_Interface @@ -50,7 +50,6 @@ def test_load_works_p1_ascii(self): test_file = os.path.join( os.path.dirname(__file__), "..", - "..", "examples", "images", "netpbm_p1_mono_ascii.pbm", @@ -86,7 +85,6 @@ def test_load_works_p4_binary(self): test_file = os.path.join( os.path.dirname(__file__), "..", - "..", "examples", "images", "netpbm_p4_mono_binary.pbm", @@ -108,7 +106,6 @@ def test_load_works_p4_binary_high_res(self): test_file = os.path.join( os.path.dirname(__file__), "..", - "..", "examples", "images", "netpbm_p4_mono_large.pbm", diff --git a/adafruit_imageload/tests/test_pgm_load.py b/tests/test_pgm_load.py similarity index 98% rename from adafruit_imageload/tests/test_pgm_load.py rename to tests/test_pgm_load.py index a7021fa..dd1bc09 100644 --- a/adafruit_imageload/tests/test_pgm_load.py +++ b/tests/test_pgm_load.py @@ -28,7 +28,7 @@ """ import os from unittest import TestCase -from .. import pnm +from adafruit_imageload import pnm from .displayio_shared_bindings import Bitmap_C_Interface, Palette_C_Interface @@ -37,7 +37,6 @@ def test_load_works_p2_ascii(self): test_file = os.path.join( os.path.dirname(__file__), "..", - "..", "examples", "images", "netpbm_p2_ascii.pgm", @@ -59,7 +58,6 @@ def test_load_works_p5_binary(self): test_file = os.path.join( os.path.dirname(__file__), "..", - "..", "examples", "images", "netpbm_p5_binary.pgm", diff --git a/adafruit_imageload/tests/test_ppm_load.py b/tests/test_ppm_load.py similarity index 97% rename from adafruit_imageload/tests/test_ppm_load.py rename to tests/test_ppm_load.py index b0cea52..5cd8854 100644 --- a/adafruit_imageload/tests/test_ppm_load.py +++ b/tests/test_ppm_load.py @@ -29,8 +29,8 @@ import os from io import BytesIO from unittest import TestCase -from .. import pnm -from ..pnm.ppm_ascii import read_three_colors +from adafruit_imageload import pnm +from adafruit_imageload.pnm.ppm_ascii import read_three_colors from .displayio_shared_bindings import Bitmap_C_Interface, Palette_C_Interface @@ -39,7 +39,6 @@ def test_load_works_p3_ascii(self): test_file = os.path.join( os.path.dirname(__file__), "..", - "..", "examples", "images", "netpbm_p3_rgb_ascii.ppm", @@ -63,7 +62,6 @@ def test_load_works_p6_binary(self): test_file = os.path.join( os.path.dirname(__file__), "..", - "..", "examples", "images", "netpbm_p6_binary.ppm",