From 49e2065ad6a5b009fc6b0fa8e721e57e26b85190 Mon Sep 17 00:00:00 2001 From: "Gerber, Mike" Date: Mon, 28 Oct 2019 14:51:41 +0100 Subject: [PATCH 1/3] =?UTF-8?q?=F0=9F=90=9B=20dinglehopper:=20Fix=20test?= =?UTF-8?q?=5Focrd=5Fcli=20for=20Python=203.5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- qurator/dinglehopper/tests/test_integ_ocrd_cli.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qurator/dinglehopper/tests/test_integ_ocrd_cli.py b/qurator/dinglehopper/tests/test_integ_ocrd_cli.py index 75d75ab..495b506 100644 --- a/qurator/dinglehopper/tests/test_integ_ocrd_cli.py +++ b/qurator/dinglehopper/tests/test_integ_ocrd_cli.py @@ -32,7 +32,7 @@ def test_ocrd_cli(tmp_path): # Copy test workspace test_workspace_dir_source = Path(data_dir) / 'actevedef_718448162' test_workspace_dir = tmp_path / 'test_ocrd_cli' - shutil.copytree(test_workspace_dir_source, test_workspace_dir) + shutil.copytree(str(test_workspace_dir_source), str(test_workspace_dir)) # str() is necessary for Python 3.5's shutil.copytree() # Run through the OCR-D interface with working_directory(test_workspace_dir): From 7cf1a540f419eb0aa789851f0c327fff2d3e4d58 Mon Sep 17 00:00:00 2001 From: "Gerber, Mike" Date: Mon, 28 Oct 2019 14:58:24 +0100 Subject: [PATCH 2/3] =?UTF-8?q?=F0=9F=90=9B=20dinglehopper:=20Fix=20test?= =?UTF-8?q?=5Focrd=5Fcli=20for=20Python=203.5,=20again?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- qurator/dinglehopper/tests/test_integ_ocrd_cli.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/qurator/dinglehopper/tests/test_integ_ocrd_cli.py b/qurator/dinglehopper/tests/test_integ_ocrd_cli.py index 495b506..9123c1b 100644 --- a/qurator/dinglehopper/tests/test_integ_ocrd_cli.py +++ b/qurator/dinglehopper/tests/test_integ_ocrd_cli.py @@ -29,13 +29,15 @@ class working_directory: def test_ocrd_cli(tmp_path): """Test OCR-D interface""" + # XXX Path.str() is necessary for Python 3.5 + # Copy test workspace test_workspace_dir_source = Path(data_dir) / 'actevedef_718448162' test_workspace_dir = tmp_path / 'test_ocrd_cli' - shutil.copytree(str(test_workspace_dir_source), str(test_workspace_dir)) # str() is necessary for Python 3.5's shutil.copytree() + shutil.copytree(str(test_workspace_dir_source), str(test_workspace_dir)) # Run through the OCR-D interface - with working_directory(test_workspace_dir): + with working_directory(str(test_workspace_dir)): runner = CliRunner() result = runner.invoke(ocrd_dinglehopper, [ '-m', 'mets.xml', @@ -44,4 +46,4 @@ def test_ocrd_cli(tmp_path): ]) assert result.exit_code == 0 result_json = list((Path(test_workspace_dir) / 'OCR-D-OCR-CALAMARI-EVAL').glob('*.json')) - assert json.load(open(result_json[0]))['cer'] < 0.03 + assert json.load(open(str(result_json[0])))['cer'] < 0.03 From 680c2a26612a240a0f816651e4a93d95d1423118 Mon Sep 17 00:00:00 2001 From: "Gerber, Mike" Date: Mon, 28 Oct 2019 15:05:08 +0100 Subject: [PATCH 3/3] =?UTF-8?q?=F0=9F=90=9B=20dinglehopper:=20Fix=20test?= =?UTF-8?q?=5Focrd=5Fcli=20for=20Python=203.5,=20again,=20and=20again?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- qurator/dinglehopper/tests/test_integ_ocrd_cli.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qurator/dinglehopper/tests/test_integ_ocrd_cli.py b/qurator/dinglehopper/tests/test_integ_ocrd_cli.py index 9123c1b..34b2380 100644 --- a/qurator/dinglehopper/tests/test_integ_ocrd_cli.py +++ b/qurator/dinglehopper/tests/test_integ_ocrd_cli.py @@ -45,5 +45,5 @@ def test_ocrd_cli(tmp_path): '-O', 'OCR-D-OCR-CALAMARI-EVAL' ]) assert result.exit_code == 0 - result_json = list((Path(test_workspace_dir) / 'OCR-D-OCR-CALAMARI-EVAL').glob('*.json')) + result_json = list((test_workspace_dir / 'OCR-D-OCR-CALAMARI-EVAL').glob('*.json')) assert json.load(open(str(result_json[0])))['cer'] < 0.03