File tree Expand file tree Collapse file tree 4 files changed +31
-12
lines changed
Expand file tree Collapse file tree 4 files changed +31
-12
lines changed Original file line number Diff line number Diff line change 33import os
44
55
6- def absjoin (* paths ) :
6+ def absjoin (* paths : str ) -> str :
77 return os .path .abspath (os .path .join (* paths ))
88
99
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" )
1212
1313# 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" )
1515
1616bool_vals = {"True" : True , "False" : False }
1717
@@ -24,15 +24,11 @@ def absjoin(*paths):
2424}
2525
2626
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`."""
3129 return absjoin (thisdir , "test_files" , "%s.docx" % name )
3230
3331
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"""
3834 return absjoin (thisdir , "test_files" , "%s" % name )
Original file line number Diff line number Diff line change 1313 "pythonVersion" : " 3.7" ,
1414 "reportImportCycles" : true ,
1515 "reportUnnecessaryCast" : true ,
16+ "reportUnnecessaryTypeIgnoreComment" : true ,
17+ "stubPath" : " ./typings" ,
1618 "typeCheckingMode" : " strict" ,
1719 "useLibraryCodeForTypes" : false ,
1820 "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