File tree Expand file tree Collapse file tree 2 files changed +12
-6
lines changed Expand file tree Collapse file tree 2 files changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -26,16 +26,13 @@ def settings(self) -> Settings:
2626 return self ._settings
2727
2828 @property
29- def path (self ) -> Path | None :
29+ def path (self ) -> Path :
30+ if self ._path is None :
31+ raise ValueError ("Path is not set" )
3032 return self ._path
3133
3234 @path .setter
3335 def path (self , path : str | Path ) -> None :
34- """
35- mypy does not like this until 1.16
36- See https://github.com/python/mypy/pull/18510
37- TODO: remove "type: ignore" from the call sites when 1.16 is available
38- """
3936 self ._path = Path (path )
4037
4138 def set_key (self , key : str , value : Any ) -> Self :
Original file line number Diff line number Diff line change 1+ import pytest
2+
3+ from commitizen .config .base_config import BaseConfig
4+
5+
6+ def test_base_config_init ():
7+ config = BaseConfig ()
8+ with pytest .raises (ValueError ):
9+ config .path
You can’t perform that action at this time.
0 commit comments