Skip to content

config: improve typing #7401

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 23, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/_pytest/_code/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from .code import getfslineno
from .code import getrawcode
from .code import Traceback
from .code import TracebackEntry
from .source import compile_ as compile
from .source import Source

Expand All @@ -17,6 +18,7 @@
"getfslineno",
"getrawcode",
"Traceback",
"TracebackEntry",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TracebackEntry is exposed through Traceback so it should be visible too (though this is an internal package anyway).

"compile",
"Source",
]
2 changes: 1 addition & 1 deletion src/_pytest/_code/code.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ def statement(self) -> "Source":
return source.getstatement(self.lineno)

@property
def path(self):
def path(self) -> Union[py.path.local, str]:
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code.path has this annoying type due to some error path, we should fix it sometime...

""" path to the source code """
return self.frame.code.path

Expand Down
Loading