Skip to content

Commit 4949ea5

Browse files
committed
refactor: improve checks
1 parent a9077ac commit 4949ea5

File tree

6 files changed

+16
-50
lines changed

6 files changed

+16
-50
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
/configs/src/
55
.ruff_cache/
66
.VSCodeCounter/
7+
/main.py
78

89
# https://github.com/github/gitignore
910
# CC0 1.0 Universal
-2 Bytes
Loading

lefthook.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ pre-commit:
1313
- name: mypy
1414
glob: "*.py"
1515
run: mypy {staged_files}
16+
exclude: tests|bin
1617
- name: poetry-check
1718
run: poetry check
1819
- name: shellcheck
@@ -27,7 +28,7 @@ pre-commit:
2728
run: check-ast {staged_files}
2829
- name: check-yaml
2930
glob: "*.{yaml,yml}"
30-
run: check-yaml {staged_files}
31+
run: check-yaml --unsafe {staged_files}
3132
- name: check-json
3233
glob: "*.json"
3334
run: check-json {staged_files}
@@ -63,6 +64,7 @@ pre-commit:
6364
glob: "*.py"
6465
run: test $RUFF != "" && $RUFF check {staged_files} || ruff check {staged_files}
6566
stage_fixed: true
67+
exclude: bin
6668
- name: poetry-export
6769
run: poetry export -f requirements.txt -o requirements.txt
6870
stage_fixed: true

main.py

Lines changed: 0 additions & 44 deletions
This file was deleted.

pyproject.toml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,14 @@ disallow_subclassing_any = false
6666
disallow_untyped_calls = true
6767
disallow_untyped_decorators = true
6868
disallow_untyped_defs = true
69-
exclude = ["__pycache__", "\\.tox", "\\.mypy_cache", "venv"]
69+
exclude = [
70+
"__pycache__",
71+
"\\.tox",
72+
"\\.mypy_cache",
73+
"venv",
74+
'bin/.*',
75+
"tests/.*"
76+
]
7077
ignore_missing_imports = true
7178
implicit_reexport = true
7279
local_partial_types = true

tests/test_isolation_source.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,24 +17,24 @@ def test_isolation_tag_system_3():
1717

1818

1919
def test_no_data():
20-
with pytest.raises(ValueError):
20+
with pytest.raises(ValueError, match=r".*"):
2121
sample.IsolationTag()
2222

2323

2424
def test_wrong_category_1():
25-
with pytest.raises(ValueError):
25+
with pytest.raises(ValueError, match=r".*"):
2626
sample.IsolationTag(level1="#StarWars", level2="#Terrestrial", level3="#Geologic")
2727

2828

2929
def test_wrong_category_2():
30-
with pytest.raises(ValueError):
30+
with pytest.raises(ValueError, match=r".*"):
3131
sample.IsolationTag(
3232
level1="#Environmental", level2="#StarWars", level3="#Geologic"
3333
)
3434

3535

3636
def test_wrong_category_3():
37-
with pytest.raises(ValueError):
37+
with pytest.raises(ValueError, match=r".*"):
3838
sample.IsolationTag(
3939
level1="#Environmental", level2="#Terrestrial", level3="#StarWars"
4040
)

0 commit comments

Comments
 (0)