aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/test_djvu_parse.py2
-rw-r--r--tests/test_grobid2json.py2
-rw-r--r--tests/test_issue_db.py4
-rw-r--r--tests/test_refs_transform.py2
-rw-r--r--tests/test_transform.py10
-rw-r--r--tests/test_work_pipeline.py2
6 files changed, 11 insertions, 11 deletions
diff --git a/tests/test_djvu_parse.py b/tests/test_djvu_parse.py
index f661f33..777f8bf 100644
--- a/tests/test_djvu_parse.py
+++ b/tests/test_djvu_parse.py
@@ -5,7 +5,7 @@ from fatcat_scholar.djvu import djvu_extract_leaf_texts
def test_djvu_extract_leaf_texts() -> None:
# https://archive.org/details/ERIC_ED441501
- with open("tests/files/ERIC_ED441501_djvu.xml") as f:
+ with open("tests/files/ERIC_ED441501_djvu.xml", "r") as f:
blob = f.read()
leaves = djvu_extract_leaf_texts(io.StringIO(blob), [3, 6])
diff --git a/tests/test_grobid2json.py b/tests/test_grobid2json.py
index bd5c0e4..345fd91 100644
--- a/tests/test_grobid2json.py
+++ b/tests/test_grobid2json.py
@@ -3,7 +3,7 @@ from fatcat_scholar.grobid2json import teixml2json
def test_grobid_teixml2json() -> None:
- with open("tests/files/example_grobid.tei.xml") as f:
+ with open("tests/files/example_grobid.tei.xml", "r") as f:
blob = f.read()
obj = teixml2json(blob, True)
diff --git a/tests/test_issue_db.py b/tests/test_issue_db.py
index d164ef6..9fdab94 100644
--- a/tests/test_issue_db.py
+++ b/tests/test_issue_db.py
@@ -16,8 +16,8 @@ def test_issue_db_basics() -> None:
issue_db = IssueDB(settings.SCHOLAR_ISSUEDB_PATH)
issue_db.init_db()
- with open("tests/files/sim_collections.json") as f:
+ with open("tests/files/sim_collections.json", "r") as f:
issue_db.load_pubs(f.readlines(), api)
- with open("tests/files/sim_items.json") as f:
+ with open("tests/files/sim_items.json", "r") as f:
issue_db.load_issues(f.readlines(), es_client)
diff --git a/tests/test_refs_transform.py b/tests/test_refs_transform.py
index 3b18557..c26ee1e 100644
--- a/tests/test_refs_transform.py
+++ b/tests/test_refs_transform.py
@@ -6,7 +6,7 @@ from fatcat_scholar.transform import refs_from_grobid
def test_transform_refs_grobid() -> None:
- with open("tests/files/example_grobid.tei.xml") as f:
+ with open("tests/files/example_grobid.tei.xml", "r") as f:
blob = f.read()
dummy_release = ReleaseEntity(
diff --git a/tests/test_transform.py b/tests/test_transform.py
index c5e189b..927c13b 100644
--- a/tests/test_transform.py
+++ b/tests/test_transform.py
@@ -7,7 +7,7 @@ from fatcat_scholar.transform import *
def test_es_release_from_release() -> None:
- with open("tests/files/release_hsmo6p4smrganpb3fndaj2lon4.json") as f:
+ with open("tests/files/release_hsmo6p4smrganpb3fndaj2lon4.json", "r") as f:
release = entity_from_json(f.read(), ReleaseEntity)
obj = es_release_from_release(release)
@@ -20,7 +20,7 @@ def test_es_release_from_release() -> None:
def test_es_biblio_from_release() -> None:
- with open("tests/files/release_hsmo6p4smrganpb3fndaj2lon4.json") as f:
+ with open("tests/files/release_hsmo6p4smrganpb3fndaj2lon4.json", "r") as f:
release = entity_from_json(f.read(), ReleaseEntity)
obj = es_biblio_from_release(release)
@@ -36,16 +36,16 @@ def test_es_biblio_from_release() -> None:
def test_run_refs() -> None:
- with open("tests/files/work_iarm6swodra2bcrzhxrfaah7py_bundle.json") as f:
+ with open("tests/files/work_iarm6swodra2bcrzhxrfaah7py_bundle.json", "r") as f:
run_refs(f.readlines())
def test_run_transform() -> None:
- with open("tests/files/work_iarm6swodra2bcrzhxrfaah7py_bundle.json") as f:
+ with open("tests/files/work_iarm6swodra2bcrzhxrfaah7py_bundle.json", "r") as f:
run_transform(f.readlines())
- with open("tests/files/sim_page_bundle.json") as f:
+ with open("tests/files/sim_page_bundle.json", "r") as f:
run_transform(f.readlines())
diff --git a/tests/test_work_pipeline.py b/tests/test_work_pipeline.py
index 39b09dc..e0e4a82 100644
--- a/tests/test_work_pipeline.py
+++ b/tests/test_work_pipeline.py
@@ -84,5 +84,5 @@ def test_run_transform(mocker: Any) -> None:
),
)
- with open("tests/files/release_hsmo6p4smrganpb3fndaj2lon4_sans.json") as f:
+ with open("tests/files/release_hsmo6p4smrganpb3fndaj2lon4_sans.json", "r") as f:
wp.run_releases(f.readlines())