From cb9fb5f7ae42a238e96e4604e5b9e15bcfceddb0 Mon Sep 17 00:00:00 2001 From: Nathan Ollerenshaw Date: Thu, 11 Jan 2024 16:59:52 -0800 Subject: [PATCH] need newer black for 3.9 and reformat a couple of files --- setup.py | 2 +- src/savage/api/data.py | 3 +-- tests/test_api.py | 6 ++---- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/setup.py b/setup.py index e4a5814..202f030 100644 --- a/setup.py +++ b/setup.py @@ -6,7 +6,7 @@ test_requires = ["pytest", "pytest-cov", "pytest-mock"] dev_requires = test_requires + [ "autopep8>=1.4.4", - 'black>=18.0.b0,<19;python_version>="3.6"', + "black>=23.12.1", "flake8", "ipython", "isort>=4.3.21", diff --git a/src/savage/api/data.py b/src/savage/api/data.py index f212fe6..10e6e52 100644 --- a/src/savage/api/data.py +++ b/src/savage/api/data.py @@ -276,8 +276,7 @@ def _get_latest_time_slice(table, session, conds, include_deleted, limit, offset def _get_limit_and_offset(page, page_size): - """Returns a 0-indexed offset and limit based on page and page_size for a MySQL query. - """ + """Returns a 0-indexed offset and limit based on page and page_size for a MySQL query.""" if page < 1: raise ValueError("page must be >= 1") limit = page_size diff --git a/tests/test_api.py b/tests/test_api.py index 568af46..f6a473b 100644 --- a/tests/test_api.py +++ b/tests/test_api.py @@ -276,8 +276,7 @@ def test_get_products_after_version(session, user_table, get_api_test_setup): def test_fields_query(session, user_table, get_api_test_setup): - """Test specifying fields and make sure dedup happens correctly. - """ + """Test specifying fields and make sure dedup happens correctly.""" p1_history, p2_history, p3_history = get_api_test_setup conds = [{"product_id": 10}] @@ -329,8 +328,7 @@ def test_fields_query(session, user_table, get_api_test_setup): def test_failure_conditions(session, user_table, get_api_test_setup): - """Pass invalid conds arguments and ensure the query fails. - """ + """Pass invalid conds arguments and ensure the query fails.""" conds = [{"product_id": 10, "foo": 15}] with pytest.raises(ValueError): get(user_table, session, t1=datetime.utcfromtimestamp(31), conds=conds)