Coverage for docs_src/parameter_types/datetime/tutorial002_an.py: 100%
5 statements
« prev ^ index » next coverage.py v7.6.1, created at 2024-09-09 18:26 +0000
« prev ^ index » next coverage.py v7.6.1, created at 2024-09-09 18:26 +0000
1from datetime import datetime 1habcdefg
3import typer 1habcdefg
4from typing_extensions import Annotated 1habcdefg
7def main( 1abcdefg
8 launch_date: Annotated[
9 datetime,
10 typer.Argument(
11 formats=["%Y-%m-%d", "%Y-%m-%dT%H:%M:%S", "%Y-%m-%d %H:%M:%S", "%m/%d/%Y"]
12 ),
13 ],
14):
15 print(f"Launch will be at: {launch_date}") 1habcdefg
18if __name__ == "__main__": 1habcdefg
19 typer.run(main) 1habcdefg