5

I try to debug my pytest-cases like this:

import pytest

def test_something()
    ...
    ...
    pytest.set_trace()

Then, i execute the tests by running elpy-test. The test starts to run and stops at pytest.set_trace() - unfortunately the compilation buffer is non-interactive and I'm stuck with a debugger that I can't use...

What's the right way to run tests in the debugger, using emacs?

5

I think that there are only the following solutions:

  • Run tests outside of Emacs from your terminal emulator
  • Run tests from realgud
  • Run tests inside Emacs via eshell. But shell output may be corrupted, so this not a good solution
  • Run tests with pytest-el. It works good, but without autocompletion.
  • I've installed and tried realgut. It's nice, but I don't understand how I can use it to solve my problem :s – Markus Jun 29 '17 at 11:50
  • Run your tests with realgud :) For example you can run tests from Emacs shell and attach it to realgud session. – sivakov512 Jun 29 '17 at 11:53
  • I added information about pytest-el to my answer. – sivakov512 Sep 6 '17 at 6:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.