-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove the "fake line numbers" hack (#39)
* Remove the fake line numbers from tracebacks by always using the line number from the source file This is done by inserting blank lines in the Python code that's exec:ed to match the source file location, letting all of the trace frames use the line number from the traceback object
- Loading branch information
Showing
5 changed files
with
126 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,10 @@ | ||
from pathlib import Path | ||
|
||
import pytest | ||
|
||
pytest_plugins = ["pytester"] | ||
|
||
|
||
@pytest.fixture() | ||
def support_dir(): | ||
return Path(__file__).parent / "support" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
def func(): | ||
""" | ||
```python | ||
import docstring_error_after | ||
docstring_error_after.error_after() | ||
``` | ||
""" | ||
|
||
|
||
def error_after(): | ||
raise Exception("bar") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
def error_before(): | ||
raise Exception("foo") | ||
|
||
|
||
def func(): | ||
""" | ||
```python | ||
import docstring_error_before | ||
docstring_error_before.error_before() | ||
``` | ||
""" |