Skip to content

Commit

Permalink
Don't use pytest for diagnostics
Browse files Browse the repository at this point in the history
  • Loading branch information
kubilus1 committed Aug 27, 2023
1 parent 80ed165 commit d513934
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
3 changes: 0 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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

Expand All @@ -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

Expand Down
19 changes: 12 additions & 7 deletions autoortho/autoortho.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import platform
import argparse
import threading
import tempfile

import aoconfig
import aostats
Expand All @@ -22,7 +23,6 @@
log = logging.getLogger(__name__)

import geocoder
import pytest
import ctypes


Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit d513934

Please sign in to comment.