Skip to content

Commit 50bd4c0

Browse files
format
1 parent 5a0df94 commit 50bd4c0

File tree

2 files changed

+18
-24
lines changed

2 files changed

+18
-24
lines changed

exasol/toolbox/nox/_artifacts.py

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
def check_artifacts(session: Session) -> None:
1515
"""Validate that all project artifacts are available and consistent"""
1616
if not_available := _missing_files(
17-
{".lint.json", ".lint.txt", ".security.json", ".coverage"}, PROJECT_CONFIG.root
17+
{".lint.json", ".lint.txt", ".security.json", ".coverage"}, PROJECT_CONFIG.root
1818
):
1919
print(f"not available: {not_available}")
2020
sys.exit(1)
@@ -64,9 +64,7 @@ def _validate_lint_json(file: Path) -> str:
6464
actual = set(issue.keys())
6565
missing = expected - actual
6666
if len(missing) > 0:
67-
return (
68-
f"Invalid format, issue {number} is missing the following attributes {missing}"
69-
)
67+
return f"Invalid format, issue {number} is missing the following attributes {missing}"
7068
return ""
7169

7270

@@ -82,9 +80,7 @@ def _validate_security_json(file: Path) -> str:
8280
expected = {"errors", "generated_at", "metrics", "results"}
8381
missing = expected - actual
8482
if len(missing) > 0:
85-
return (
86-
f"Invalid format, the file is missing the following attributes {missing}"
87-
)
83+
return f"Invalid format, the file is missing the following attributes {missing}"
8884
return ""
8985

9086

@@ -95,13 +91,16 @@ def _validate_coverage(path: Path) -> str:
9591
return f"database connection not possible, details: {ex}"
9692
cursor = conn.cursor()
9793
try:
98-
actual_tables = set(cursor.execute("select name from sqlite_schema where type == 'table'"))
94+
actual_tables = set(
95+
cursor.execute("select name from sqlite_schema where type == 'table'")
96+
)
9997
except sqlite3.Error as ex:
10098
return f"schema query not possible, details: {ex}"
10199
expected = {"coverage_schema", "meta", "file", "line_bits"}
102100
actual = {f[0] for f in actual_tables if (f[0] in expected)}
103101
missing = expected - actual
104102
if len(missing) > 0:
105-
return f"Invalid database, the database is missing the following tables {missing}"
103+
return (
104+
f"Invalid database, the database is missing the following tables {missing}"
105+
)
106106
return ""
107-

test/unit/lint_file_check_test.py

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -252,25 +252,22 @@ def test_check_lint_json(attributes, expected, tmp_path):
252252
@pytest.mark.parametrize(
253253
"attributes,expected",
254254
[
255-
(
256-
["errors", "generated_at", "metrics", "results"],
257-
""
258-
),
255+
(["errors", "generated_at", "metrics", "results"], ""),
259256
(
260257
["generated_at", "metrics", "results"],
261-
"Invalid format, the file is missing the following attributes {'errors'}"
258+
"Invalid format, the file is missing the following attributes {'errors'}",
262259
),
263260
(
264261
["errors", "metrics", "results"],
265-
"Invalid format, the file is missing the following attributes {'generated_at'}"
262+
"Invalid format, the file is missing the following attributes {'generated_at'}",
266263
),
267264
(
268265
["errors", "generated_at", "results"],
269-
"Invalid format, the file is missing the following attributes {'metrics'}"
266+
"Invalid format, the file is missing the following attributes {'metrics'}",
270267
),
271268
(
272269
["errors", "generated_at", "metrics"],
273-
"Invalid format, the file is missing the following attributes {'results'}"
270+
"Invalid format, the file is missing the following attributes {'results'}",
274271
),
275272
],
276273
)
@@ -289,20 +286,18 @@ def test_check_security_json(attributes, expected, tmp_path):
289286
@pytest.mark.parametrize(
290287
"tables, expected",
291288
[
292-
(
293-
["coverage_schema", "meta", "file", "line_bits"], ""
294-
),
289+
(["coverage_schema", "meta", "file", "line_bits"], ""),
295290
(
296291
["meta", "file", "line_bits"],
297-
"Invalid database, the database is missing the following tables {'coverage_schema'}"
292+
"Invalid database, the database is missing the following tables {'coverage_schema'}",
298293
),
299294
(
300295
["coverage_schema", "file", "line_bits"],
301-
"Invalid database, the database is missing the following tables {'meta'}"
296+
"Invalid database, the database is missing the following tables {'meta'}",
302297
),
303298
(
304299
["coverage_schema", "meta", "line_bits"],
305-
"Invalid database, the database is missing the following tables {'file'}"
300+
"Invalid database, the database is missing the following tables {'file'}",
306301
),
307302
(
308303
[

0 commit comments

Comments
 (0)