diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index a9132aac..b86ae46a 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -66,7 +66,7 @@ jobs: # black is synced with the .pre-commit-hooks version run: | python -m pip install --upgrade pip - pip install bandit[toml] pycodestyle pylint black==22.12.0 + pip install bandit[toml] pycodestyle pylint black==23.11.0 - name: Run pycodestyle # E203: pycodestyle is a little too rigid about slices & whitespace diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 370ec9b9..240bd1ad 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,7 +1,7 @@ repos: - repo: https://github.com/psf/black # this version is synced with the black mentioned in .github/workflows/ci.yml - rev: 22.12.0 + rev: 23.11.0 hooks: - id: black entry: bash -c 'black "$@"; git add -u' -- diff --git a/cumulus_etl/common.py b/cumulus_etl/common.py index c45a694b..924a0f2b 100644 --- a/cumulus_etl/common.py +++ b/cumulus_etl/common.py @@ -22,6 +22,7 @@ # ############################################################################### + # We often want the ability to provide a TemporaryDirectory _or_ an actual real folder that isn't temporary. # So for that use case, we define a Directory protocol for typing purposes, which looks like a TemporaryDirectory. # And then a RealDirectory class that does not delete its folder. diff --git a/pyproject.toml b/pyproject.toml index 02c03693..83bb7bac 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -75,6 +75,6 @@ tests = [ "respx", ] dev = [ - "black == 22.12.0", + "black == 23.11.0", "pre-commit" ] diff --git a/tests/etl/test_batching.py b/tests/etl/test_batching.py index 70158a9d..08f463d6 100644 --- a/tests/etl/test_batching.py +++ b/tests/etl/test_batching.py @@ -90,6 +90,7 @@ class TestBatching(AsyncTestCase): @ddt.unpack async def test_batch_iterate(self, values, batch_size, expected): """Check a bunch of edge cases for the batch_iterate helper""" + # Tiny little convenience method to be turn sync lists into async iterators. async def async_iter() -> AsyncIterator: for x in values: diff --git a/tests/fhir/test_fhir_client.py b/tests/fhir/test_fhir_client.py index 06cc17eb..feacf61e 100644 --- a/tests/fhir/test_fhir_client.py +++ b/tests/fhir/test_fhir_client.py @@ -283,7 +283,9 @@ async def test_get_error_429(self): ) async def test_get_error_other(self, response_args): """Verify that other http errors are FatalErrors.""" - self.respx_mock.get(f"{self.server_url}/foo",).mock( + self.respx_mock.get( + f"{self.server_url}/foo", + ).mock( return_value=make_response(status_code=500, **response_args), ) @@ -333,11 +335,16 @@ def mock_as_server_type(self, server_type: str | None): @ddt.unpack async def test_client_id_in_header(self, server_type, expected_text): # Mock with header - self.respx_mock.get(f"{self.server_url}/file", headers={"Epic-Client-ID": "my-id"},).respond( + self.respx_mock.get( + f"{self.server_url}/file", + headers={"Epic-Client-ID": "my-id"}, + ).respond( text="present", ) # And without - self.respx_mock.get(f"{self.server_url}/file",).respond( + self.respx_mock.get( + f"{self.server_url}/file", + ).respond( text="missing", ) diff --git a/tests/test_bulk_export.py b/tests/test_bulk_export.py index 352dd3eb..900dadc2 100644 --- a/tests/test_bulk_export.py +++ b/tests/test_bulk_export.py @@ -276,7 +276,9 @@ def set_up_requests(self, respx_mock): ) # /token - respx_mock.post(f"{self.root.path}/token",).respond( + respx_mock.post( + f"{self.root.path}/token", + ).respond( json={ "access_token": "1234567890", },