Unit Tests ?

  • Nobody/Anonymous


      I was just wondering what the 'run as python unit-test' option is supposed to do?  When I use that to run my pyunit test file, All I get is the stderr output in the console.  Where does the pass/fail, summary data, etc. show up? (btw, my unit test file works as expected if run with 'run as python')

    • Fabio Zadrozny

      Fabio Zadrozny - 2006-02-13

      It is useful for running all the tests beneath a folder... There is no 'pretty' output right now, just the output to the console of what is running and its results at the end (with the fail conditions, if any).

      If you want to tweak with that run, you can play with the file at org.python.pydev.debug_xxxx\pysrc\runfiles.py

      (it is the file that loads and runs all the unit-tests found).



      Example of the output:

      Finding files... ['x:\\scbr15\\source\\python\\scbr\\editors\\table\\tests']
      Importing test modules... done.
      Test if the addition of an element on table it's ok. ... ok
      Test if the addition of an element with blank lines into an element and other element ...
      Test if elements are added to the table. ... FAIL
      Test if elements are filled to the table. ... ok
      Test removal pre-conditions ... ok
      testIt (test_locale.Test) ... ok

      FAIL: Test if elements are added to the table.
      Traceback (most recent call last):
        File "x:\scbr15\source\python\scbr\editors\table\tests\test_gui_group.py", line 209, in testAddElements
          self._assertEquals('ethanol', DBContaminantTable, 0, 1)
        File "x:\scbr15\source\python\scbr\editors\table\tests\test_gui_group.py", line 260, in _assertEquals
          self.assertEquals(value, self.win.getTable(clas).text(row, col).latin1())
      AssertionError: 'ethanol' != 'benzene'

      Ran 27 tests in 4.109s

      FAILED (failures=1)

    • Nobody/Anonymous

      I just started using PyDev (1.0.3 since I am tied to an old version of Python) and I see the test output in the Windows Command window from where I started Eclipse, but I don't see it in the Eclipse console.  Am I missing a preference to have it show up in Eclipse?

      • Fabio Zadrozny

        Fabio Zadrozny - 2006-04-27

        Sorry, I'm kind of 'out-of-context' here... What exactly are you trying to do?

        Also, the latest versions of pydev should handle old versions of python... If they don't you should post a bug.