Skip to content

Commit

Permalink
Fix missing import, add os.PathLike helptext test
Browse files Browse the repository at this point in the history
  • Loading branch information
brentyi committed Feb 14, 2023
1 parent 4abc342 commit 0d22057
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tests/test_helptext.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import dataclasses
import enum
import os
import pathlib
from collections.abc import Callable
from typing import Any, Dict, Generic, List, Optional, Tuple, TypeVar, Union, cast
Expand Down Expand Up @@ -562,3 +563,11 @@ def main2(x: Callable = nn.ReLU):
assert "--x {fixed}" in helptext
assert "(fixed to:" in helptext
assert "torch" in helptext


def test_pathlike() -> None:
def main(x: os.PathLike) -> None:
pass

helptext = get_helptext(main)
assert "--x PATH " in helptext
1 change: 1 addition & 0 deletions tests/test_tyro.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import copy
import dataclasses
import enum
import os
import pathlib
from typing import (
Any,
Expand Down

0 comments on commit 0d22057

Please sign in to comment.