File tree 4 files changed +31
-12
lines changed 4 files changed +31
-12
lines changed Original file line number Diff line number Diff line change 3
3
import os
4
4
5
5
6
- def absjoin (* paths ) :
6
+ def absjoin (* paths : str ) -> str :
7
7
return os .path .abspath (os .path .join (* paths ))
8
8
9
9
10
- thisdir = os .path .split (__file__ )[0 ]
11
- scratch_dir = absjoin (thisdir , "../_scratch" )
10
+ thisdir : str = os .path .split (__file__ )[0 ]
11
+ scratch_dir : str = absjoin (thisdir , "../_scratch" )
12
12
13
13
# scratch output docx file -------------
14
- saved_docx_path = absjoin (scratch_dir , "test_out.docx" )
14
+ saved_docx_path : str = absjoin (scratch_dir , "test_out.docx" )
15
15
16
16
bool_vals = {"True" : True , "False" : False }
17
17
@@ -24,15 +24,11 @@ def absjoin(*paths):
24
24
}
25
25
26
26
27
- def test_docx (name ):
28
- """
29
- Return the absolute path to test .docx file with root name `name`.
30
- """
27
+ def test_docx (name : str ):
28
+ """Return the absolute path to test .docx file with root name `name`."""
31
29
return absjoin (thisdir , "test_files" , "%s.docx" % name )
32
30
33
31
34
- def test_file (name ):
35
- """
36
- Return the absolute path to file with `name` in test_files directory
37
- """
32
+ def test_file (name : str ):
33
+ """Return the absolute path to file with `name` in test_files directory"""
38
34
return absjoin (thisdir , "test_files" , "%s" % name )
Original file line number Diff line number Diff line change 13
13
"pythonVersion" : " 3.7" ,
14
14
"reportImportCycles" : true ,
15
15
"reportUnnecessaryCast" : true ,
16
+ "reportUnnecessaryTypeIgnoreComment" : true ,
17
+ "stubPath" : " ./typings" ,
16
18
"typeCheckingMode" : " strict" ,
17
19
"useLibraryCodeForTypes" : false ,
18
20
"verboseOutput" : true
Original file line number Diff line number Diff line change
1
+ from __future__ import annotations
2
+
3
+ from typing import Callable
4
+
5
+ from typing_extensions import Concatenate , ParamSpec , TypeAlias
6
+
7
+ from .runner import Context
8
+
9
+ _P = ParamSpec ("_P" )
10
+
11
+ _ArgsStep : TypeAlias = Callable [Concatenate [Context , _P ], None ]
12
+ _NoArgsStep : TypeAlias = Callable [[Context ], None ]
13
+
14
+ _Step : TypeAlias = _NoArgsStep | _ArgsStep [str ]
15
+
16
+ def given (phrase : str ) -> Callable [[_Step ], _Step ]: ...
17
+ def when (phrase : str ) -> Callable [[_Step ], _Step ]: ...
18
+ def then (phrase : str ) -> Callable [[_Step ], _Step ]: ...
Original file line number Diff line number Diff line change
1
+ from types import SimpleNamespace
2
+
3
+ class Context (SimpleNamespace ): ...
You can’t perform that action at this time.
0 commit comments