10

Is there any straightforward way or should I use an external tool like Nose?

yanchenko
  • 56,576
  • 33
  • 147
  • 165
  • But the real question is: how to run in-place doctest-code in PyDev (i.e. "select-and-execute"), like PyCharm does? http://stackoverflow.com/questions/29240835/how-do-i-run-doctests-with-pycharm – ankostis Jan 11 '17 at 22:16

2 Answers2

7

Pydev 1.6.4 provides support for a nose test runner.

http://pydev.org/manual_adv_pyunit.html describes how to configure the nose test runner.

To run doc tests, you'll need to specify the --with-doctest switch for the nose runner.

Steven Bluen
  • 141
  • 2
  • 11
xverges
  • 4,608
  • 1
  • 39
  • 60
2

Xv's answer is correct, unless you have tests that are in external files (like testable specifications) in which case you should add the doctest-extension=txt switch (substituting txt for whatever your extension is).

Ctrlspc
  • 1,596
  • 1
  • 15
  • 22