Skip to content

Commit 8d20a27

Browse files
rjeffmanmrbrandao
authored andcommitted
type checking: Fix type check warnings
Running `ty` on a clean repository raises a few warnings due to the possibility of the return of a function being None and using the object afterwards. Signed-off-by: Rafael Guterres Jeffman <rjeffman@redhat.com>
1 parent 17a9754 commit 8d20a27

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

tests/test_single_skill.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ def test_get_skill_paths_returns_content_path(self, tmp_path):
9090
""")
9191

9292
module = Module.from_path(module_dir)
93+
assert module is not None
9394
paths = module.get_skill_paths()
9495
assert len(paths) == 1
9596
assert paths[0] == module_dir
@@ -105,6 +106,7 @@ def test_skills_root_dir_returns_content_path(self, tmp_path):
105106
""")
106107

107108
module = Module.from_path(module_dir)
109+
assert module is not None
108110
assert module._skills_root_dir() == module_dir
109111

110112
def test_single_skill_in_module_subdirectory(self, tmp_path):
@@ -147,6 +149,7 @@ def test_single_skill_validates_successfully(self, tmp_path):
147149
""")
148150

149151
module = Module.from_path(module_dir)
152+
assert module is not None
150153
is_valid, errors = module.validate()
151154
assert is_valid
152155
assert errors == []
@@ -161,6 +164,7 @@ def test_single_skill_validation_missing_description(self, tmp_path):
161164
""")
162165

163166
module = Module.from_path(module_dir)
167+
assert module is not None
164168
is_valid, errors = module.validate()
165169
assert not is_valid
166170
assert len(errors) > 0

0 commit comments

Comments
 (0)