From 80ed165b496adf8d6b33fe6b33f7269db92213c5 Mon Sep 17 00:00:00 2001 From: Matt Kubilus Date: Sun, 27 Aug 2023 13:09:38 -0400 Subject: [PATCH 1/2] Try to include pytest --- Makefile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Makefile b/Makefile index abd68e42..791dd013 100644 --- a/Makefile +++ b/Makefile @@ -28,6 +28,7 @@ bin: autoortho/.version --include-data-file=./autoortho/lib/linux/*.so=lib/linux/ \ --include-data-file=./autoortho/aoimage/*.so=aoimage/ \ --include-data-dir=./autoortho/imgs=imgs \ + --noinclude-pytest-mode=INCLUDE_PYTEST_MODE \ --onefile \ ./autoortho/__main__.py -o autoortho_lin.bin @@ -44,6 +45,7 @@ _autoortho_win.exe: autoortho/.version --include-data-file=./autoortho/lib/windows/*=lib/windows/ \ --include-data-file=./autoortho/aoimage/*.dll=aoimage/ \ --include-data-dir=./autoortho/imgs=imgs \ + --noinclude-pytest-mode=INCLUDE_PYTEST_MODE \ --onefile \ ./autoortho/__main__.py -o autoortho_win.exe @@ -60,6 +62,7 @@ __main__.dist: autoortho/.version --include-data-file=./autoortho/lib/windows/*=lib/windows/ \ --include-data-file=./autoortho/aoimage/*.dll=aoimage/ \ --include-data-dir=./autoortho/imgs=imgs \ + --noinclude-pytest-mode=INCLUDE_PYTEST_MODE \ --standalone \ ./autoortho/__main__.py -o autoortho_win.exe From d5139340646cdfc20fa59661b76588adb949b196 Mon Sep 17 00:00:00 2001 From: Matt Kubilus Date: Sun, 27 Aug 2023 13:26:04 -0400 Subject: [PATCH 2/2] Don't use pytest for diagnostics --- Makefile | 3 --- autoortho/autoortho.py | 19 ++++++++++++------- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/Makefile b/Makefile index 791dd013..abd68e42 100644 --- a/Makefile +++ b/Makefile @@ -28,7 +28,6 @@ bin: autoortho/.version --include-data-file=./autoortho/lib/linux/*.so=lib/linux/ \ --include-data-file=./autoortho/aoimage/*.so=aoimage/ \ --include-data-dir=./autoortho/imgs=imgs \ - --noinclude-pytest-mode=INCLUDE_PYTEST_MODE \ --onefile \ ./autoortho/__main__.py -o autoortho_lin.bin @@ -45,7 +44,6 @@ _autoortho_win.exe: autoortho/.version --include-data-file=./autoortho/lib/windows/*=lib/windows/ \ --include-data-file=./autoortho/aoimage/*.dll=aoimage/ \ --include-data-dir=./autoortho/imgs=imgs \ - --noinclude-pytest-mode=INCLUDE_PYTEST_MODE \ --onefile \ ./autoortho/__main__.py -o autoortho_win.exe @@ -62,7 +60,6 @@ __main__.dist: autoortho/.version --include-data-file=./autoortho/lib/windows/*=lib/windows/ \ --include-data-file=./autoortho/aoimage/*.dll=aoimage/ \ --include-data-dir=./autoortho/imgs=imgs \ - --noinclude-pytest-mode=INCLUDE_PYTEST_MODE \ --standalone \ ./autoortho/__main__.py -o autoortho_win.exe diff --git a/autoortho/autoortho.py b/autoortho/autoortho.py index a05ec76d..c1cb2f57 100644 --- a/autoortho/autoortho.py +++ b/autoortho/autoortho.py @@ -7,6 +7,7 @@ import platform import argparse import threading +import tempfile import aoconfig import aostats @@ -22,7 +23,6 @@ log = logging.getLogger(__name__) import geocoder -import pytest import ctypes @@ -62,12 +62,17 @@ def diagnose(CFG): if not ret: failed = True - ret = pytest.main([ - "-vv", - "autoortho/test_getortho.py::test_maptype_chunk" - ]) - if ret != 0: - failed = True + log.info(f"Checking maptypes:") + import getortho + for maptype in CFG.autoortho.maptypes: + with tempfile.TemporaryDirectory() as tmpdir: + c = getortho.Chunk(2176, 3232, maptype, 13, cache_dir=tmpdir) + ret = c.get() + if ret: + log.info(f" Maptype: {maptype} OK!") + else: + log.warning(f" Maptype: {maptype} FAILED!") + failed = True log.info("------------------------------------") if failed: