diff --git a/test/hca_metadata_api/test.py b/test/hca_metadata_api/test.py index 50dc71a8e..dadbefd6a 100644 --- a/test/hca_metadata_api/test.py +++ b/test/hca_metadata_api/test.py @@ -518,7 +518,7 @@ def test_imaging_protocol(self): version = '2019-04-03T103426.471000Z' manifest, metadata_files = self._canned_bundle('staging', uuid, version) bundle = Bundle(uuid, version, manifest, metadata_files) - imaging_protocol = one([p for p in bundle.protocols.values() if isinstance(p, ImagingProtocol)]) + imaging_protocol = one(p for p in bundle.protocols.values() if isinstance(p, ImagingProtocol)) self.assertEqual(len(imaging_protocol.probe), 240) assay_types = {probe.assay_type for probe in imaging_protocol.probe} self.assertEqual(assay_types, {'in situ sequencing'}) @@ -547,7 +547,7 @@ def test_links_json_v2_0_0(self): manifest, metadata_files = self._canned_bundle('prod', uuid, version) bundle = Bundle(uuid, version, manifest, metadata_files) for expected_count, link_type in [(6, 'process_link'), (2, 'supplementary_file_link')]: - actual_count = sum([1 for link in bundle.links if link.link_type == link_type]) + actual_count = sum(1 for link in bundle.links if link.link_type == link_type) self.assertEqual(expected_count, actual_count) for link in bundle.links: self.assertIn(link.source_type, api_entity_types) diff --git a/test/indexer/test_indexer.py b/test/indexer/test_indexer.py index b7997641d..84843c0df 100644 --- a/test/indexer/test_indexer.py +++ b/test/indexer/test_indexer.py @@ -1597,7 +1597,7 @@ def test_cell_line_sample(self): document_ids = one(contents[sample_entity_type])['document_id'] else: document_ids = [d['document_id'] for d in contents[sample_entity_type]] - entity = one([d for d in contents[sample_entity_type] if d['document_id'] == sample['document_id']]) + entity = one(d for d in contents[sample_entity_type] if d['document_id'] == sample['document_id']) self.assertEqual(sample['biomaterial_id'], entity['biomaterial_id']) self.assertTrue(sample['document_id'] in document_ids) self.assertEqual(one(contents['specimens'])['organ'], ['blood'] if aggregate else 'blood') diff --git a/test/service/test_manifest.py b/test/service/test_manifest.py index 1587a7c0f..0ab15e689 100644 --- a/test/service/test_manifest.py +++ b/test/service/test_manifest.py @@ -1048,7 +1048,7 @@ def _extract_bdbag_response(self, self.assertEqual(200, response.status_code) with ZipFile(BytesIO(response.content), 'r') as zip_fh: zip_fh.extractall(zip_dir) - self.assertTrue(all(['manifest' == first(name.split('/')) for name in zip_fh.namelist()])) + self.assertTrue(all('manifest' == first(name.split('/')) for name in zip_fh.namelist())) zip_fname = os.path.dirname(first(zip_fh.namelist())) with open(os.path.join(zip_dir, zip_fname, 'data', 'participants.tsv'), 'r') as fh: reader = csv.DictReader(fh, delimiter='\t')