From 10a2374051568edf3d872988e730328d899a0fdd Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Wed, 3 Nov 2021 12:29:39 -0700 Subject: typing: first batch of python bulk type annotations While these changes are more delicate than simple lint changes, this specific batch of edits and annotations was *relatively* simple, and resulted in few code changes other than function signature additions. --- python/tests/import_common.py | 2 +- python/tests/transform_csl.py | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) (limited to 'python/tests') diff --git a/python/tests/import_common.py b/python/tests/import_common.py index cd89f914..6e66c295 100644 --- a/python/tests/import_common.py +++ b/python/tests/import_common.py @@ -6,7 +6,7 @@ import elasticsearch import fatcat_openapi_client import fuzzycat.matching import pytest -from fatcat_openapi_client import ReleaseEntity, ReleaseExtIds +from fatcat_openapi_client import ReleaseContrib, ReleaseEntity, ReleaseExtIds from fixtures import * from fatcat_tools.importers import EntityImporter diff --git a/python/tests/transform_csl.py b/python/tests/transform_csl.py index 2bf584ba..2b6fab31 100644 --- a/python/tests/transform_csl.py +++ b/python/tests/transform_csl.py @@ -1,4 +1,5 @@ import json +from typing import Any import pytest from fatcat_openapi_client import ReleaseEntity @@ -8,7 +9,7 @@ from import_crossref import crossref_importer from fatcat_tools.transforms import citeproc_csl, entity_from_json, release_to_csl -def test_csl_crossref(crossref_importer): +def test_csl_crossref(crossref_importer: Any) -> None: with open("tests/files/crossref-works.single.json", "r") as f: # not a single line raw = json.loads(f.read()) @@ -30,7 +31,7 @@ def test_csl_crossref(crossref_importer): citeproc_csl(csl, "csl-json") -def test_csl_pubmed(crossref_importer): +def test_csl_pubmed(crossref_importer: Any) -> None: with open("tests/files/example_releases_pubmed19n0972.json", "r") as f: # multiple single lines for line in f: @@ -42,7 +43,7 @@ def test_csl_pubmed(crossref_importer): citeproc_csl(csl, "harvard1", html=True) -def test_csl_pubmed_bibtex(crossref_importer): +def test_csl_pubmed_bibtex(crossref_importer: Any) -> None: with open("tests/files/example_releases_pubmed19n0972.json", "r") as f: r = entity_from_json(f.readline(), ReleaseEntity) csl = release_to_csl(r) -- cgit v1.2.3