PytestRun test failures parsing is broken for tests in a class
Review Request #2714 - Created Aug. 27, 2015 and submitted
|benjyw, jsirois, stuhood|
Fix a bug in pytest_run where failures from tests in class are not parsed properly. For tests that are inside the class, the failure line for each test failure will look like the following:
The regex pants uses to get the source file name was
As a result, the file path doesn't match the source of the failing target which resulted in TestFailedTaskError always have an empty failed targets list.
Here is an example of a results log from a python test target.
self = <test_check_subprocess.TestCheckSubprocess object at 0x1072b6a10>def test_log_subprocess_failure(self): command = [ 'python', '-c', textwrap.dedent(''' import sys sys.stdout.write("stdout\\n") sys.stderr.write("stderr\\n") sys.exit(1)''') ]assert 1 == 2
E assert 1 == 2
This only showed up just now on pants-reviews because of Matt's reply. I get driven dis-proportionally insane by this style of problem emanating from @twitter.com RBs (in this case from gmail.com, but the point is from tweeps). In this case the RB account firstname.lastname@example.org is not subscribed to email@example.com, but in-general this is a persistent problem with RBs from Twitter contributors. I'm very aware that Twitter has more non-typical contributors step-up than any other pants community sponsor, but nonetheless it would be awesome if there was some way Tweeps could help improve the onboarding of contributions to mitigate this steady trickle of fumbling.