From 5c39fa4b9a2c43d94d1eef68ac24f1d0099d219a Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Thu, 23 Jul 2020 15:28:40 -0700 Subject: simple lint (flake8) fixes in tests The pytest fixture syntax interacts weirdly with flake8 tests, so ignore the "redefinition" and "unused variable" errors more carefully for .py files under ./tests/ --- python/tests/api_editgroups.py | 1 - python/tests/api_entity_state.py | 2 +- python/tests/api_releases.py | 2 +- python/tests/import_ingest.py | 2 +- 4 files changed, 3 insertions(+), 4 deletions(-) (limited to 'python/tests') diff --git a/python/tests/api_editgroups.py b/python/tests/api_editgroups.py index 142687c2..b4420b29 100644 --- a/python/tests/api_editgroups.py +++ b/python/tests/api_editgroups.py @@ -98,7 +98,6 @@ def test_editgroup_auto_batch(api): def test_batch_params(api): - eg = quick_eg(api) c1 = CreatorEntity(display_name="test auto_batch") c2 = CreatorEntity(display_name="test another auto_batch") diff --git a/python/tests/api_entity_state.py b/python/tests/api_entity_state.py index d5ba6301..4b49083e 100644 --- a/python/tests/api_entity_state.py +++ b/python/tests/api_entity_state.py @@ -359,7 +359,7 @@ def test_self_redirect(api): c1_redirect = CreatorEntity(redirect=c1.ident) eg = quick_eg(api) with pytest.raises(fatcat_openapi_client.rest.ApiException): - merge_edit = api.update_creator(eg.editgroup_id, c1.ident, c1_redirect) + api.update_creator(eg.editgroup_id, c1.ident, c1_redirect) def test_wip_redirect(api): diff --git a/python/tests/api_releases.py b/python/tests/api_releases.py index c4c05ea6..9c70f655 100644 --- a/python/tests/api_releases.py +++ b/python/tests/api_releases.py @@ -177,7 +177,7 @@ def test_empty_fields(api): title="something", contribs=[ReleaseContrib(raw_name="somebody")], ext_ids=ReleaseExtIds()) - r1edit = api.create_release(eg.editgroup_id, r1) + api.create_release(eg.editgroup_id, r1) with pytest.raises(fatcat_openapi_client.rest.ApiException): r2 = ReleaseEntity(title="", ext_ids=ReleaseExtIds()) diff --git a/python/tests/import_ingest.py b/python/tests/import_ingest.py index ebe2923c..4a46232a 100644 --- a/python/tests/import_ingest.py +++ b/python/tests/import_ingest.py @@ -63,7 +63,7 @@ def test_ingest_importer_stage(ingest_importer, api): eg = quick_eg(api) r1 = api.lookup_release(doi="10.123/abc") r1.release_stage = row['release_stage'] - c1 = api.update_release(eg.editgroup_id, r1.ident, r1) + api.update_release(eg.editgroup_id, r1.ident, r1) api.accept_editgroup(eg.editgroup_id) # set ingest request stage -- cgit v1.2.3 From 1b28ba68e3b25a0cded2e88b88134d8d332f8d96 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Thu, 23 Jul 2020 15:29:48 -0700 Subject: fix actual typo in tests (caught by lint) --- python/tests/api_annotations.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'python/tests') diff --git a/python/tests/api_annotations.py b/python/tests/api_annotations.py index 0606b637..79acaa4b 100644 --- a/python/tests/api_annotations.py +++ b/python/tests/api_annotations.py @@ -30,5 +30,5 @@ def test_annotations(api): if thing.annotation_id == a[0].annotation_id: found = thing break - assert thing - assert thing.extra['thing'] == "thang" + assert found + assert found.extra['thing'] == "thang" -- cgit v1.2.3