-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/report-offending-file' into main
- Loading branch information
Showing
4 changed files
with
45 additions
and
20 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
Empty file.
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,21 @@ | ||
from pathlib import Path | ||
import responses, traceback | ||
|
||
from tests.cli_test_case import CliTestCase | ||
|
||
|
||
class TestsTest(CliTestCase): | ||
|
||
@responses.activate | ||
def test_filename_in_error_message(self): | ||
broken_xml = str(Path(__file__).parent.joinpath('../../data/broken.xml').resolve()) | ||
self.cli('record', 'tests', '--build', self.build_name, 'file', broken_xml) | ||
# mock doesn't evaluate generator so we need to do so here | ||
g = responses.calls[1].request.body | ||
try: | ||
b''.join(g) | ||
except Exception as e: | ||
# making sure the offending file path name is being printed. | ||
self.assertIn(broken_xml, traceback.format_exc()) | ||
else: | ||
self.fail("Expected to see an error") |
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 @@ | ||
this is not an XML! |