From 534319a48337cb8e3cd824238b20e477a934a06c Mon Sep 17 00:00:00 2001 From: Michael Franklin Date: Thu, 14 Sep 2023 16:35:43 +1000 Subject: [PATCH] Slight linting updates --- .github/workflows/lint.yaml | 2 ++ scripts/parse_ped.py | 4 ++-- test/test_generic_auditor.py | 7 +++++-- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index d4863658a..01424f2df 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -20,6 +20,8 @@ jobs: run: | pip install -r requirements-dev.txt pip install . + # test to see if this is happier + mkdir .mypy_cache - name: pre-commit run: pre-commit run --all-files diff --git a/scripts/parse_ped.py b/scripts/parse_ped.py index 894d0c241..d77b46fc0 100644 --- a/scripts/parse_ped.py +++ b/scripts/parse_ped.py @@ -1,7 +1,6 @@ """ A really simple script to import a pedigree file """ import click - from cloudpathlib import CloudPath from metamist.apis import ( @@ -17,7 +16,8 @@ def main(ped_file_path: str, project: str): fapi = FamilyApi() - with CloudPath(ped_file_path).open() as ped_file: + # pylint: disable=no-member + with CloudPath(ped_file_path).open() as ped_file: # type: ignore fapi.import_pedigree( file=ped_file, has_header=True, diff --git a/test/test_generic_auditor.py b/test/test_generic_auditor.py index 4fb526dc9..f9aa1c2e8 100644 --- a/test/test_generic_auditor.py +++ b/test/test_generic_auditor.py @@ -1,6 +1,7 @@ -from collections import namedtuple import unittest +from collections import namedtuple from unittest.mock import MagicMock, patch + from metamist.audit.generic_auditor import GenericAuditor # pylint: disable=dangerous-default-value @@ -569,7 +570,9 @@ def test_analyses_for_sgs_without_crams(self, mock_query): } with self.assertLogs(level='WARNING') as log: - _ = auditor.analyses_for_sgs_without_crams(sgs_without_crams) + # catch the warning logs from here and check below + auditor.analyses_for_sgs_without_crams(sgs_without_crams) + self.assertEqual(len(log.output), 8) # 8 analysis types checked self.assertEqual(len(log.records), 8) self.assertIn(