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:
26
26
return self ._settings
27
27
28
28
@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" )
30
32
return self ._path
31
33
32
34
@path .setter
33
35
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
- """
39
36
self ._path = Path (path )
40
37
41
38
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