You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
test ArtefactStore.reset
test string as inputs for ArtefactStore.add, ArtefactStore.copy_artefacts, ArtefactStore.replace and CollectionGetter
test string as input for value of ArtefactStore.update_dict
test dict as input for add_files of ArtefactStore.replace
test str and ArtefactsGetter as inputs for CollectionGetter
potentially group tests together in classes, similar to class TestFilterBuildTrees
And strange, if I try to prevent from strings being used (specifying Path instead of str as parameters do add in the ArtefactStore), the string is still accepted without any error. And confusingly: why is mypy quiet about providing a Path where the parameter is supposed to be a string??
OK, the error is not detected because the function isn't typed (--> mypy ignores it). Adding --> None:
def test_artefact_store_copy() -> None:
then results in:
$ mypy source/ tests/unit_tests/test_artefacts.py
tests/unit_tests/test_artefacts.py:38: error: Argument 2 to "add" of "ArtefactStore" has incompatible type "Path"; expected "str | list[str] | set[str]" [arg-type]
tests/unit_tests/test_artefacts.py:42: error: List item 0 has incompatible type "Path"; expected "str" [list-item]
tests/unit_tests/test_artefacts.py:42: error: List item 1 has incompatible type "Path"; expected "str" [list-item]
tests/unit_tests/test_artefacts.py:43: error: List item 0 has incompatible type "Path"; expected "str" [list-item]
tests/unit_tests/test_artefacts.py:43: error: List item 1 has incompatible type "Path"; expected "str" [list-item]
Trying to consistently fix this in this test raises a lot of mypy warnings :(
The text was updated successfully, but these errors were encountered:
As commented by @jasonjunweilyu :
A quick change of using strs fails:
And strange, if I try to prevent from strings being used (specifying Path instead of str as parameters do add in the ArtefactStore), the string is still accepted without any error. And confusingly: why is
mypy
quiet about providing a Path where the parameter is supposed to be a string??OK, the error is not detected because the function isn't typed (--> mypy ignores it). Adding
--> None
:then results in:
Trying to consistently fix this in this test raises a lot of mypy warnings :(
The text was updated successfully, but these errors were encountered: