aboutsummaryrefslogtreecommitdiffstats
path: root/python
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2020-07-01 18:35:37 -0700
committerBryan Newbold <bnewbold@robocracy.org>2020-07-01 18:35:37 -0700
commitce37bdcd382c857383aad219de53d2432c07f1e7 (patch)
tree9dd1b9421f7650358acab4e9d39fb1e33d3bc31d /python
parent30905f1effb33c3ef193d084120aa3fbd75d0b9b (diff)
downloadfatcat-ce37bdcd382c857383aad219de53d2432c07f1e7.tar.gz
fatcat-ce37bdcd382c857383aad219de53d2432c07f1e7.zip
lint (flake8) python test files
Diffstat (limited to 'python')
-rw-r--r--python/tests/api_annotations.py5
-rw-r--r--python/tests/api_containers.py8
-rw-r--r--python/tests/api_creators.py7
-rw-r--r--python/tests/api_editgroups.py3
-rw-r--r--python/tests/api_editor.py9
-rw-r--r--python/tests/api_entity_editing.py4
-rw-r--r--python/tests/api_files.py7
-rw-r--r--python/tests/api_filesets.py6
-rw-r--r--python/tests/api_misc.py6
-rw-r--r--python/tests/api_releases.py6
-rw-r--r--python/tests/api_webcaptures.py5
-rw-r--r--python/tests/citation_efficiency.py6
-rw-r--r--python/tests/clean_files.py3
-rw-r--r--python/tests/fixtures.py5
-rw-r--r--python/tests/harvest_crossref.py1
-rw-r--r--python/tests/harvest_datacite.py1
-rw-r--r--python/tests/harvest_pubmed.py6
-rw-r--r--python/tests/harvest_state.py2
-rw-r--r--python/tests/import_arabesque.py3
-rw-r--r--python/tests/import_arxiv.py6
-rw-r--r--python/tests/import_crossref.py6
-rw-r--r--python/tests/import_datacite.py42
-rw-r--r--python/tests/import_grobid_metadata.py3
-rw-r--r--python/tests/import_ingest.py1
-rw-r--r--python/tests/import_jalc.py6
-rw-r--r--python/tests/import_journal_metadata.py3
-rw-r--r--python/tests/import_jstor.py6
-rw-r--r--python/tests/import_matched.py3
-rw-r--r--python/tests/import_orcid.py3
-rw-r--r--python/tests/import_pubmed.py7
-rw-r--r--python/tests/import_shadow.py4
-rw-r--r--python/tests/importer.py5
-rw-r--r--python/tests/subentity_state.py6
-rw-r--r--python/tests/tools_api.py1
-rw-r--r--python/tests/transform_csl.py4
-rw-r--r--python/tests/transform_elasticsearch.py6
-rw-r--r--python/tests/transform_ingest.py5
-rw-r--r--python/tests/web_auth.py3
-rw-r--r--python/tests/web_citation_csl.py2
-rw-r--r--python/tests/web_editgroup.py5
-rw-r--r--python/tests/web_editing.py4
-rw-r--r--python/tests/web_editor.py4
-rw-r--r--python/tests/web_entity_views.py4
-rw-r--r--python/tests/web_routes.py4
-rw-r--r--python/tests/web_search.py3
45 files changed, 71 insertions, 168 deletions
diff --git a/python/tests/api_annotations.py b/python/tests/api_annotations.py
index e5566eef..0606b637 100644
--- a/python/tests/api_annotations.py
+++ b/python/tests/api_annotations.py
@@ -1,10 +1,5 @@
-import json
-import pytest
-from copy import copy
-
from fatcat_openapi_client import *
-from fatcat_openapi_client.rest import ApiException
from fixtures import *
diff --git a/python/tests/api_containers.py b/python/tests/api_containers.py
index 0850fab7..70dbcd7e 100644
--- a/python/tests/api_containers.py
+++ b/python/tests/api_containers.py
@@ -1,10 +1,5 @@
-import json
-import pytest
-from copy import copy
-
from fatcat_openapi_client import *
-from fatcat_openapi_client.rest import ApiException
from fixtures import *
@@ -43,7 +38,7 @@ def test_container(api):
# get redirects (none)
assert api.get_container_redirects(c2.ident) == []
-
+
# delete
eg = quick_eg(api)
api.delete_container(eg.editgroup_id, c2.ident)
@@ -59,4 +54,3 @@ def test_container_examples(api):
c2 = api.lookup_container(issnl=c1.issnl)
assert c1.ident == c2.ident
-
diff --git a/python/tests/api_creators.py b/python/tests/api_creators.py
index 1ce6380a..b271e2b3 100644
--- a/python/tests/api_creators.py
+++ b/python/tests/api_creators.py
@@ -1,10 +1,5 @@
-import json
-import pytest
-from copy import copy
-
from fatcat_openapi_client import *
-from fatcat_openapi_client.rest import ApiException
from fixtures import *
@@ -52,7 +47,7 @@ def test_creators(api):
assert c1.display_name == c3.display_name
assert c1.extra == c3.extra
-
+
# delete
eg = quick_eg(api)
api.delete_creator(eg.editgroup_id, c2.ident)
diff --git a/python/tests/api_editgroups.py b/python/tests/api_editgroups.py
index d82c9233..142687c2 100644
--- a/python/tests/api_editgroups.py
+++ b/python/tests/api_editgroups.py
@@ -1,11 +1,8 @@
-import json
import pytest
import datetime
-from copy import copy
from fatcat_openapi_client import *
-from fatcat_openapi_client.rest import ApiException
from fixtures import *
diff --git a/python/tests/api_editor.py b/python/tests/api_editor.py
index 64bb2759..91881743 100644
--- a/python/tests/api_editor.py
+++ b/python/tests/api_editor.py
@@ -1,12 +1,5 @@
-import json
-import pytest
-import datetime
-from copy import copy
-
-from fatcat_openapi_client import *
-from fatcat_openapi_client.rest import ApiException
-from fixtures import *
+from fixtures import api
def test_editor_update(api):
diff --git a/python/tests/api_entity_editing.py b/python/tests/api_entity_editing.py
index d5377e18..fee4e34f 100644
--- a/python/tests/api_entity_editing.py
+++ b/python/tests/api_entity_editing.py
@@ -1,10 +1,7 @@
-import json
import pytest
-from copy import copy
from fatcat_openapi_client import *
-from fatcat_openapi_client.rest import ApiException
from fixtures import *
@@ -180,4 +177,3 @@ def test_edit_delete_all(api_dummy_entities):
assert len(eg.edits.webcaptures) == 0
assert len(eg.edits.releases) == 0
assert len(eg.edits.works) == 0
-
diff --git a/python/tests/api_files.py b/python/tests/api_files.py
index 74865daa..65eda993 100644
--- a/python/tests/api_files.py
+++ b/python/tests/api_files.py
@@ -1,10 +1,5 @@
-import json
-import pytest
-from copy import copy
-
from fatcat_openapi_client import *
-from fatcat_openapi_client.rest import ApiException
from fixtures import *
@@ -50,7 +45,7 @@ def test_file(api):
# get redirects (none)
assert api.get_file_redirects(f2.ident) == []
-
+
# delete
eg = quick_eg(api)
api.delete_file(eg.editgroup_id, f2.ident)
diff --git a/python/tests/api_filesets.py b/python/tests/api_filesets.py
index 7f3235cb..6d755744 100644
--- a/python/tests/api_filesets.py
+++ b/python/tests/api_filesets.py
@@ -1,10 +1,7 @@
-import json
import pytest
-from copy import copy
from fatcat_openapi_client import *
-from fatcat_openapi_client.rest import ApiException
from fixtures import *
@@ -64,7 +61,7 @@ def test_fileset(api):
# get redirects (none)
assert api.get_fileset_redirects(fs2.ident) == []
-
+
# delete
eg = quick_eg(api)
api.delete_fileset(eg.editgroup_id, fs2.ident)
@@ -100,4 +97,3 @@ def test_bad_fileset(api):
for b in bad_list:
with pytest.raises(fatcat_openapi_client.rest.ApiException):
api.create_fileset(eg.editgroup_id, b)
-
diff --git a/python/tests/api_misc.py b/python/tests/api_misc.py
index 11f85fd6..4c9ac9a6 100644
--- a/python/tests/api_misc.py
+++ b/python/tests/api_misc.py
@@ -1,10 +1,5 @@
-import json
-import pytest
-from copy import copy
-
from fatcat_openapi_client import *
-from fatcat_openapi_client.rest import ApiException
from fixtures import *
@@ -45,4 +40,3 @@ def test_unexpected_body(api):
)
f1.urls = [dict(url="http://thing", rel="repository", asdf="blue")]
api.create_file(eg.editgroup_id, f1)
-
diff --git a/python/tests/api_releases.py b/python/tests/api_releases.py
index 2df08698..c4c05ea6 100644
--- a/python/tests/api_releases.py
+++ b/python/tests/api_releases.py
@@ -1,11 +1,8 @@
-import json
import pytest
import datetime
-from copy import copy
from fatcat_openapi_client import *
-from fatcat_openapi_client.rest import ApiException
from fixtures import *
@@ -130,7 +127,7 @@ def test_release(api):
# get redirects (none)
assert api.get_release_redirects(r2.ident) == []
-
+
# delete
eg = quick_eg(api)
api.delete_release(eg.editgroup_id, r2.ident)
@@ -210,4 +207,3 @@ def test_controlled_vocab(api):
api.create_release(eg.editgroup_id, r3)
r3.withdrawn_status = "spam"
api.create_release(eg.editgroup_id, r3)
-
diff --git a/python/tests/api_webcaptures.py b/python/tests/api_webcaptures.py
index 1054b41f..85813218 100644
--- a/python/tests/api_webcaptures.py
+++ b/python/tests/api_webcaptures.py
@@ -1,11 +1,8 @@
-import json
import pytest
import datetime
-from copy import copy
from fatcat_openapi_client import *
-from fatcat_openapi_client.rest import ApiException
from fixtures import *
@@ -84,7 +81,7 @@ def test_webcapture(api):
# get redirects (none)
assert api.get_webcapture_redirects(wc2.ident) == []
-
+
# delete
eg = quick_eg(api)
api.delete_webcapture(eg.editgroup_id, wc2.ident)
diff --git a/python/tests/citation_efficiency.py b/python/tests/citation_efficiency.py
index aefb7d15..f8807db6 100644
--- a/python/tests/citation_efficiency.py
+++ b/python/tests/citation_efficiency.py
@@ -1,10 +1,5 @@
-import json
-import pytest
-from copy import copy
-
from fatcat_openapi_client import *
-from fatcat_openapi_client.rest import ApiException
from fixtures import *
@@ -110,4 +105,3 @@ def test_citation_encoding(api):
assert container == r1.refs[0].container_name
assert extra == r1.refs[0].extra
assert locator == r1.refs[0].locator
-
diff --git a/python/tests/clean_files.py b/python/tests/clean_files.py
index 8a87f218..ce1102be 100644
--- a/python/tests/clean_files.py
+++ b/python/tests/clean_files.py
@@ -1,9 +1,10 @@
import copy
import pytest
+
from fatcat_tools.cleanups import FileCleaner
from fatcat_openapi_client import *
-from fixtures import api
+from fixtures import *
@pytest.fixture(scope="function")
diff --git a/python/tests/fixtures.py b/python/tests/fixtures.py
index 78742114..44c7be63 100644
--- a/python/tests/fixtures.py
+++ b/python/tests/fixtures.py
@@ -1,8 +1,4 @@
-import os
-import time
-import json
-import signal
import pytest
from dotenv import load_dotenv
import fatcat_web
@@ -87,4 +83,3 @@ def test_get_changelog_entry(api):
def quick_eg(api_inst):
eg = api_inst.create_editgroup(fatcat_openapi_client.Editgroup())
return eg
-
diff --git a/python/tests/harvest_crossref.py b/python/tests/harvest_crossref.py
index e902cda5..cad0f03b 100644
--- a/python/tests/harvest_crossref.py
+++ b/python/tests/harvest_crossref.py
@@ -1,6 +1,5 @@
import json
-import pytest
import datetime
import responses
from fatcat_tools.harvest import *
diff --git a/python/tests/harvest_datacite.py b/python/tests/harvest_datacite.py
index 004d1fef..13c6042a 100644
--- a/python/tests/harvest_datacite.py
+++ b/python/tests/harvest_datacite.py
@@ -1,6 +1,5 @@
import json
-import pytest
import datetime
import responses
from fatcat_tools.harvest import *
diff --git a/python/tests/harvest_pubmed.py b/python/tests/harvest_pubmed.py
index f8db46b6..58bc4226 100644
--- a/python/tests/harvest_pubmed.py
+++ b/python/tests/harvest_pubmed.py
@@ -2,14 +2,11 @@
Test pubmed FTP harvest.
"""
-import datetime
-import json
import os
-
+import datetime
import pytest
from fatcat_tools.harvest import *
-from fatcat_tools.harvest.pubmed import generate_date_file_map
def test_pubmed_harvest_date(mocker):
@@ -77,4 +74,3 @@ def test_pubmed_harvest_date_no_pmid(mocker):
# The file has not PMID, not importable.
with pytest.raises(ValueError):
harvester.fetch_date(datetime.datetime.strptime(test_date, '%Y-%m-%d'))
-
diff --git a/python/tests/harvest_state.py b/python/tests/harvest_state.py
index 8b7deba6..cc624d97 100644
--- a/python/tests/harvest_state.py
+++ b/python/tests/harvest_state.py
@@ -1,6 +1,4 @@
-import json
-import pytest
import datetime
from fatcat_tools.harvest import *
diff --git a/python/tests/import_arabesque.py b/python/tests/import_arabesque.py
index 9483eb45..20cde3a6 100644
--- a/python/tests/import_arabesque.py
+++ b/python/tests/import_arabesque.py
@@ -1,8 +1,9 @@
import json
import pytest
+
from fatcat_tools.importers import ArabesqueMatchImporter, SqlitePusher, JsonLinePusher
-from fixtures import api
+from fixtures import *
@pytest.fixture(scope="function")
diff --git a/python/tests/import_arxiv.py b/python/tests/import_arxiv.py
index 1e649616..9306e67c 100644
--- a/python/tests/import_arxiv.py
+++ b/python/tests/import_arxiv.py
@@ -1,10 +1,10 @@
-import json, gzip
import pytest
-from fatcat_tools.importers import ArxivRawImporter, Bs4XmlFilePusher
-from fixtures import api
from bs4 import BeautifulSoup
+from fatcat_tools.importers import ArxivRawImporter, Bs4XmlFilePusher
+from fixtures import *
+
@pytest.fixture(scope="function")
def arxiv_importer(api):
diff --git a/python/tests/import_crossref.py b/python/tests/import_crossref.py
index afa2410f..65cd2c37 100644
--- a/python/tests/import_crossref.py
+++ b/python/tests/import_crossref.py
@@ -1,8 +1,10 @@
-import json, gzip
+import json
+import gzip
import pytest
+
from fatcat_tools.importers import CrossrefImporter, JsonLinePusher
-from fixtures import api
+from fixtures import *
@pytest.fixture(scope="function")
diff --git a/python/tests/import_datacite.py b/python/tests/import_datacite.py
index 20c1eaf8..8fb2d079 100644
--- a/python/tests/import_datacite.py
+++ b/python/tests/import_datacite.py
@@ -2,15 +2,17 @@
Test datacite importer.
"""
-import collections
+import gzip
+import json
import datetime
+import collections
+
import pytest
-import gzip
+
from fatcat_tools.importers import DataciteImporter, JsonLinePusher
-from fatcat_tools.importers.datacite import find_original_language_title, parse_datacite_titles, parse_datacite_dates, clean_doi, index_form_to_display_name, lookup_license_slug
+from fatcat_tools.importers.datacite import find_original_language_title, parse_datacite_titles, parse_datacite_dates, index_form_to_display_name, lookup_license_slug
from fatcat_tools.transforms import entity_to_dict
-from fixtures import api
-import json
+from fixtures import *
@pytest.fixture(scope="function")
@@ -295,7 +297,7 @@ def test_datacite_conversions(datacite_importer):
re = datacite_importer.parse_record(json.load(f))
result = entity_to_dict(re)
with open(dst, 'r') as f:
- expected = json.loads(f.read())
+ expected = json.loads(f.read())
assert result == expected, 'output mismatch in {}'.format(dst)
@@ -340,20 +342,20 @@ def test_lookup_license_slug():
Case('http://onlinelibrary.wiley.com/termsAndConditions', 'WILEY'),
Case('https://publikationen.bibliothek.kit.edu/kitopen-lizenz', 'KIT-OPEN'),
Case('http://journals.sagepub.com/page/policies/text-and-data-mining-license', 'SAGE-TDM'),
- Case('https://creativecommons.org/publicdomain/mark/1.0/deed.de', 'CC-PUBLICDOMAIN'),
- Case('http://creativecommons.org/publicdomain/mark/1.0', 'CC-PUBLICDOMAIN'),
- Case('https://creativecommons.org/publicdomain/mark/1.0', 'CC-PUBLICDOMAIN'),
- Case('https://creativecommons.org/publicdomain/mark/1.0/', 'CC-PUBLICDOMAIN'),
- Case('https://creativecommons.org/publicdomain/mark/1.0/deed.de', 'CC-PUBLICDOMAIN'),
- Case('https://creativecommons.org/share-your-work/public-domain/cc0/', 'CC-0'),
- Case('http://spdx.org/licenses/CC0-1.0.json', 'CC-0'),
- Case('http://spdx.org/licenses/CC-BY-1.0.json', 'CC-BY'),
- Case('http://spdx.org/licenses/CC-BY-4.0.json', 'CC-BY'),
- Case('http://spdx.org/licenses/CC-BY-NC-4.0.json', 'CC-BY-NC'),
- Case('http://spdx.org/licenses/CC-BY-SA-3.0.json', 'CC-BY-SA'),
- Case('http://spdx.org/licenses/CC-BY-SA-4.0.json', 'CC-BY-SA'),
- Case('http://spdx.org/licenses/MIT.json', 'MIT'),
- Case('http://spdx.org/licenses/OGL-Canada-2.0.json', 'OGL-CANADA'),
+ Case('https://creativecommons.org/publicdomain/mark/1.0/deed.de', 'CC-PUBLICDOMAIN'),
+ Case('http://creativecommons.org/publicdomain/mark/1.0', 'CC-PUBLICDOMAIN'),
+ Case('https://creativecommons.org/publicdomain/mark/1.0', 'CC-PUBLICDOMAIN'),
+ Case('https://creativecommons.org/publicdomain/mark/1.0/', 'CC-PUBLICDOMAIN'),
+ Case('https://creativecommons.org/publicdomain/mark/1.0/deed.de', 'CC-PUBLICDOMAIN'),
+ Case('https://creativecommons.org/share-your-work/public-domain/cc0/', 'CC-0'),
+ Case('http://spdx.org/licenses/CC0-1.0.json', 'CC-0'),
+ Case('http://spdx.org/licenses/CC-BY-1.0.json', 'CC-BY'),
+ Case('http://spdx.org/licenses/CC-BY-4.0.json', 'CC-BY'),
+ Case('http://spdx.org/licenses/CC-BY-NC-4.0.json', 'CC-BY-NC'),
+ Case('http://spdx.org/licenses/CC-BY-SA-3.0.json', 'CC-BY-SA'),
+ Case('http://spdx.org/licenses/CC-BY-SA-4.0.json', 'CC-BY-SA'),
+ Case('http://spdx.org/licenses/MIT.json', 'MIT'),
+ Case('http://spdx.org/licenses/OGL-Canada-2.0.json', 'OGL-CANADA'),
]
for c in cases:
diff --git a/python/tests/import_grobid_metadata.py b/python/tests/import_grobid_metadata.py
index 51ab3faa..52284b89 100644
--- a/python/tests/import_grobid_metadata.py
+++ b/python/tests/import_grobid_metadata.py
@@ -3,8 +3,9 @@ import os
import json
import base64
import pytest
+
from fatcat_tools.importers import GrobidMetadataImporter, LinePusher
-from fixtures import api
+from fixtures import *
"""
WARNING: these tests are currently very fragile because they have database
diff --git a/python/tests/import_ingest.py b/python/tests/import_ingest.py
index 02486de6..ebe2923c 100644
--- a/python/tests/import_ingest.py
+++ b/python/tests/import_ingest.py
@@ -1,6 +1,7 @@
import json
import pytest
+
from fatcat_tools.importers import IngestFileResultImporter, JsonLinePusher
from fixtures import *
diff --git a/python/tests/import_jalc.py b/python/tests/import_jalc.py
index f61ec849..ff757e51 100644
--- a/python/tests/import_jalc.py
+++ b/python/tests/import_jalc.py
@@ -1,10 +1,10 @@
-import json, gzip
import pytest
-from fatcat_tools.importers import JalcImporter, Bs4XmlFilePusher, Bs4XmlLinesPusher
-from fixtures import api
from bs4 import BeautifulSoup
+from fatcat_tools.importers import JalcImporter, Bs4XmlFilePusher, Bs4XmlLinesPusher
+from fixtures import *
+
@pytest.fixture(scope="function")
def jalc_importer(api):
diff --git a/python/tests/import_journal_metadata.py b/python/tests/import_journal_metadata.py
index cfeee517..51b0a78a 100644
--- a/python/tests/import_journal_metadata.py
+++ b/python/tests/import_journal_metadata.py
@@ -1,7 +1,8 @@
import pytest
+
from fatcat_tools.importers import JournalMetadataImporter, JsonLinePusher
-from fixtures import api
+from fixtures import *
@pytest.fixture(scope="function")
diff --git a/python/tests/import_jstor.py b/python/tests/import_jstor.py
index 019f0aae..8494ffb2 100644
--- a/python/tests/import_jstor.py
+++ b/python/tests/import_jstor.py
@@ -1,10 +1,10 @@
-import json, gzip
import pytest
-from fatcat_tools.importers import JstorImporter, Bs4XmlFilePusher
-from fixtures import api
from bs4 import BeautifulSoup
+from fatcat_tools.importers import JstorImporter, Bs4XmlFilePusher
+from fixtures import *
+
@pytest.fixture(scope="function")
def jstor_importer(api):
diff --git a/python/tests/import_matched.py b/python/tests/import_matched.py
index 72ed068c..6b61c53c 100644
--- a/python/tests/import_matched.py
+++ b/python/tests/import_matched.py
@@ -1,8 +1,9 @@
import json
import pytest
+
from fatcat_tools.importers import MatchedImporter, JsonLinePusher
-from fixtures import api
+from fixtures import *
@pytest.fixture(scope="function")
diff --git a/python/tests/import_orcid.py b/python/tests/import_orcid.py
index 57886b52..f78ccde7 100644
--- a/python/tests/import_orcid.py
+++ b/python/tests/import_orcid.py
@@ -1,8 +1,9 @@
import json
import pytest
+
from fatcat_tools.importers import OrcidImporter, JsonLinePusher
-from fixtures import api
+from fixtures import *
@pytest.fixture(scope="function")
diff --git a/python/tests/import_pubmed.py b/python/tests/import_pubmed.py
index f57aa273..201f533c 100644
--- a/python/tests/import_pubmed.py
+++ b/python/tests/import_pubmed.py
@@ -1,10 +1,10 @@
-import json, gzip
import pytest
-from fatcat_tools.importers import PubmedImporter, Bs4XmlLargeFilePusher
-from fixtures import api
from bs4 import BeautifulSoup
+from fatcat_tools.importers import PubmedImporter, Bs4XmlLargeFilePusher
+from fixtures import *
+
@pytest.fixture(scope="function")
def pubmed_importer(api):
@@ -137,4 +137,3 @@ def test_pubmed_xml_parse_refs(pubmed_importer):
r1 = pubmed_importer.parse_record(soup.find_all("PubmedArticle")[0])
assert len(r1.refs) > 1
-
diff --git a/python/tests/import_shadow.py b/python/tests/import_shadow.py
index 70a918d2..40a1d589 100644
--- a/python/tests/import_shadow.py
+++ b/python/tests/import_shadow.py
@@ -1,8 +1,9 @@
import json
import pytest
+
from fatcat_tools.importers import ShadowLibraryImporter, JsonLinePusher
-from fixtures import api
+from fixtures import *
@pytest.fixture(scope="function")
@@ -58,4 +59,3 @@ def test_shadow_dict_parse(shadow_importer):
assert u.url.startswith("https://web.archive.org/")
assert "20180729135948" in u.url
assert len(f.release_ids) == 1
-
diff --git a/python/tests/importer.py b/python/tests/importer.py
index 9308ba84..a412b247 100644
--- a/python/tests/importer.py
+++ b/python/tests/importer.py
@@ -1,8 +1,6 @@
-
-import pytest
from fatcat_tools.importers import CrossrefImporter, OrcidImporter
-from fixtures import api
+from fixtures import *
def test_issnl_mapping_lookup(api):
@@ -32,4 +30,3 @@ def test_identifiers(api):
assert oi.is_orcid("0000-00x3-3118-659") == False
assert oi.is_orcid("0000-00033118-659") == False
assert oi.is_orcid("0000-0003-3118-659.") == False
-
diff --git a/python/tests/subentity_state.py b/python/tests/subentity_state.py
index 614f88f1..e03fa99e 100644
--- a/python/tests/subentity_state.py
+++ b/python/tests/subentity_state.py
@@ -1,10 +1,5 @@
-import json
-import pytest
-from copy import copy
-
from fatcat_openapi_client import *
-from fatcat_openapi_client.rest import ApiException
from fixtures import *
"""
@@ -221,4 +216,3 @@ def test_app_entity_states(api, app):
assert rv.status_code == 200
rv = app.get('/work/{}'.format(r2.work_id))
assert rv.status_code == 302
-
diff --git a/python/tests/tools_api.py b/python/tests/tools_api.py
index fd26b8ee..a4b5f2ea 100644
--- a/python/tests/tools_api.py
+++ b/python/tests/tools_api.py
@@ -1,6 +1,5 @@
import pytest
-from fatcat_openapi_client import EditgroupAnnotation
from fatcat_openapi_client.rest import ApiException
from fatcat_tools import public_api, authenticated_api
diff --git a/python/tests/transform_csl.py b/python/tests/transform_csl.py
index 15c64ce5..6436f876 100644
--- a/python/tests/transform_csl.py
+++ b/python/tests/transform_csl.py
@@ -1,11 +1,11 @@
import json
import pytest
+
from fatcat_tools import *
from fatcat_openapi_client import *
-
-from fixtures import api
from import_crossref import crossref_importer
+from fixtures import *
def test_csl_crossref(crossref_importer):
with open('tests/files/crossref-works.single.json', 'r') as f:
diff --git a/python/tests/transform_elasticsearch.py b/python/tests/transform_elasticsearch.py
index a954fc4d..f791562c 100644
--- a/python/tests/transform_elasticsearch.py
+++ b/python/tests/transform_elasticsearch.py
@@ -1,13 +1,13 @@
import json
-import pytest
+
from fatcat_tools import *
from fatcat_openapi_client import *
-from fixtures import api
from import_journal_metadata import journal_metadata_importer
-
from import_crossref import crossref_importer
from import_matched import matched_importer
+from fixtures import *
+
def test_basic_elasticsearch_convert(crossref_importer):
with open('tests/files/crossref-works.single.json', 'r') as f:
diff --git a/python/tests/transform_ingest.py b/python/tests/transform_ingest.py
index 2d5652b8..c7044bc0 100644
--- a/python/tests/transform_ingest.py
+++ b/python/tests/transform_ingest.py
@@ -1,12 +1,12 @@
import json
-import pytest
+
from fatcat_tools.transforms import release_ingest_request
from fatcat_openapi_client import *
from fixtures import api
-
from import_crossref import crossref_importer
+
def test_basic_ingest_release(crossref_importer):
with open('tests/files/crossref-works.single.json', 'r') as f:
# not a single line
@@ -54,4 +54,3 @@ def test_rich_ingest_release():
assert ir['base_url'] == 'https://doi.org/10.123/456'
assert ir['ext_ids']['doi'] == '10.123/456'
assert ir['ext_ids'].get('pmcid') is None
-
diff --git a/python/tests/web_auth.py b/python/tests/web_auth.py
index 2c545b6b..643d806e 100644
--- a/python/tests/web_auth.py
+++ b/python/tests/web_auth.py
@@ -1,8 +1,5 @@
-import json
-import pytest
import responses
-from fatcat_openapi_client.rest import ApiException
from fixtures import *
diff --git a/python/tests/web_citation_csl.py b/python/tests/web_citation_csl.py
index e016b2d9..fb3ce58d 100644
--- a/python/tests/web_citation_csl.py
+++ b/python/tests/web_citation_csl.py
@@ -1,8 +1,6 @@
import json
-import tempfile
import pytest
-from fatcat_openapi_client.rest import ApiException
from fixtures import *
diff --git a/python/tests/web_editgroup.py b/python/tests/web_editgroup.py
index cbdd2176..20dc8d93 100644
--- a/python/tests/web_editgroup.py
+++ b/python/tests/web_editgroup.py
@@ -1,9 +1,7 @@
-import json
-import pytest
-from fatcat_openapi_client.rest import ApiException
from fixtures import *
+
def test_editgroup_basics(app):
rv = app.get('/editgroup/aaaaaaaaaaaabo53aaaaaaaaae')
@@ -59,4 +57,3 @@ def test_editgroup_annotations_login(app_admin):
assert rv.status_code == 200
assert b'Signup' not in rv.data
assert b'Add Comment' in rv.data
-
diff --git a/python/tests/web_editing.py b/python/tests/web_editing.py
index 773a59dd..17f4f5ae 100644
--- a/python/tests/web_editing.py
+++ b/python/tests/web_editing.py
@@ -1,7 +1,4 @@
-import json
-import pytest
-from fatcat_openapi_client.rest import ApiException
from fixtures import *
@@ -147,4 +144,3 @@ def test_web_edit_get(app_admin):
rv = app_admin.get('/container/aaaaaaaaaaaaaeiraaaaaaaaam/edit')
assert rv.status_code == 200
assert b'1549-1277' in rv.data
-
diff --git a/python/tests/web_editor.py b/python/tests/web_editor.py
index 2614be96..58b21ddf 100644
--- a/python/tests/web_editor.py
+++ b/python/tests/web_editor.py
@@ -1,7 +1,4 @@
-import json
-import pytest
-from fatcat_openapi_client.rest import ApiException
from fixtures import *
@@ -25,4 +22,3 @@ def test_change_username(app_admin):
assert rv.status_code == 200
rv = app_admin.get('/auth/account')
assert b'admin-tmp' not in rv.data
-
diff --git a/python/tests/web_entity_views.py b/python/tests/web_entity_views.py
index a3f0f897..c1cbdc29 100644
--- a/python/tests/web_entity_views.py
+++ b/python/tests/web_entity_views.py
@@ -1,7 +1,4 @@
-import json
-import pytest
-from fatcat_openapi_client.rest import ApiException
from fixtures import *
from fatcat_web.forms import ReleaseEntityForm, FileEntityForm, ContainerEntityForm
@@ -367,4 +364,3 @@ def test_web_work(app):
assert rv.status_code == 404
rv = app.get('/work/create')
assert rv.status_code == 404
-
diff --git a/python/tests/web_routes.py b/python/tests/web_routes.py
index 026776ee..0edf06d1 100644
--- a/python/tests/web_routes.py
+++ b/python/tests/web_routes.py
@@ -1,7 +1,4 @@
-import json
-import pytest
-from fatcat_openapi_client.rest import ApiException
from fixtures import *
@@ -13,4 +10,3 @@ def test_static_routes(app):
assert app.get("/search").status_code == 302
assert app.get("/static/bogus/route").status_code == 404
-
diff --git a/python/tests/web_search.py b/python/tests/web_search.py
index 24b817dc..7647bcf5 100644
--- a/python/tests/web_search.py
+++ b/python/tests/web_search.py
@@ -1,8 +1,7 @@
import json
-import pytest
import responses
-from fatcat_openapi_client.rest import ApiException
+
from fixtures import *
@responses.activate