Skip to content
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

Stack trace is useless #283

Closed
avkonst opened this issue Aug 19, 2020 · 1 comment
Closed

Stack trace is useless #283

avkonst opened this issue Aug 19, 2020 · 1 comment

Comments

@avkonst
Copy link

avkonst commented Aug 19, 2020

While developing tests I have noticed that these stack dumps are annoying:

FAIL: gabbi-runner.input_auth
        Traceback (most recent call last):
          File "/usr/lib/python3/dist-packages/gabbi/case.py", line 94, in wrapper
            func(self)
          File "/usr/lib/python3/dist-packages/gabbi/case.py", line 143, in test_request
            self._run_test()
          File "/usr/lib/python3/dist-packages/gabbi/case.py", line 550, in _run_test
            self._assert_response()
          File "/usr/lib/python3/dist-packages/gabbi/case.py", line 188, in _assert_response
            self._test_status(self.test_data['status'], self.response['status'])
          File "/usr/lib/python3/dist-packages/gabbi/case.py", line 591, in _test_status
            self.assert_in_or_print_output(observed_status, statii)
          File "/usr/lib/python3/dist-packages/gabbi/case.py", line 654, in assert_in_or_print_output
            self.assertIn(expected, iterable)
          File "/usr/lib/python3/dist-packages/testtools/testcase.py", line 417, in assertIn
            self.assertThat(haystack, Contains(needle), message)
          File "/usr/lib/python3/dist-packages/testtools/testcase.py", line 498, in assertThat
            raise mismatch_error
        testtools.matchers._impl.MismatchError: '400' not in ['200']

What I am interested in is the last line really. Ideally it should follow right after the test name, which is marked as failed:

✗ gabbi-runner.input_auth

Currently I always need to scroll up though the useless stacktrace to find out the test name.

@cdent
Copy link
Owner

cdent commented Aug 19, 2020

From #282 it looks like you are using an old version of gabbi. This situation is improved (when using gabbi-run) in newer versions:

FAIL: gabbi-runner.test_bad_body
	'400' not found in ['200'], response:
	{
	  "errors": [
	    {
	      "id": "ds1/NPukzFqW80-000009:-1",
	      "status": 400,
	      "title": "Bad Request",
	      "detail": "Request body has an error: header 'Content-Type' has unexpected value: \"ponies\""
	    }
	  ]
	}

@cdent cdent closed this as completed Aug 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants