From 23821cba57a390f1328db04bf844ff52e54cb8ae Mon Sep 17 00:00:00 2001 From: Mike Gerber Date: Mon, 13 Mar 2023 19:35:04 +0100 Subject: [PATCH] =?UTF-8?q?=E2=9C=94=20Do=20not=20delete=20test=20workspac?= =?UTF-8?q?e=20when=20DEBUG=20env=20variable=20is=20set?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/test_recognize.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/test_recognize.py b/test/test_recognize.py index 8b33029..4d456b5 100644 --- a/test/test_recognize.py +++ b/test/test_recognize.py @@ -16,6 +16,7 @@ from .base import assets METS_KANT = assets.url_of('kant_aufklaerung_1784-page-region-line-word_glyph/data/mets.xml') WORKSPACE_DIR = tempfile.mkdtemp(prefix='test-ocrd-calamari-') CHECKPOINT_DIR = os.getenv('MODEL') +DEBUG = os.getenv('DEBUG', False) def page_namespace(tree): @@ -83,7 +84,8 @@ def workspace(): yield workspace - shutil.rmtree(WORKSPACE_DIR) + if not DEBUG: + shutil.rmtree(WORKSPACE_DIR) def test_recognize(workspace):