Modify

Opened 5 months ago

Last modified 5 months ago

#11778 new enhancement

How do you invoke tests?

Reported by: ChrisNelson Owned by: hoessler
Priority: normal Component: EstimationToolsPlugin
Severity: normal Keywords:
Cc: Trac Release: 0.11

Description

I want to be sure some changes I've made haven't broken anything (and, perhaps, add tests for those changes/additions) but I can't figure out how to invoke the tests.

~/src/trac/plugins/estimationtoolsplugin/estimationtools$ ls
burndownchart.py       htdocs       tests
hoursinplaceeditor.py  __init__.py  utils.py
hoursremaining.py      templates    workloadchart.py
~/src/trac/plugins/estimationtoolsplugin/estimationtools$ sudo python tests/burndownchart.py 
Traceback (most recent call last):
  File "tests/burndownchart.py", line 3, in <module>
    from estimationtools.burndownchart import BurndownChart
ImportError: No module named estimationtools.burndownchart
~/src/trac/plugins/estimationtoolsplugin/estimationtools$ cd tests/
~/src/trac/plugins/estimationtoolsplugin/estimationtools/tests$ sudo python burndownchart.py 
Traceback (most recent call last):
  File "burndownchart.py", line 3, in <module>
    from estimationtools.burndownchart import BurndownChart
ImportError: No module named estimationtools.burndownchart

Attachments (0)

Change History (2)

comment:1 Changed 5 months ago by rjollos

From the root directory you can execute python setup.py test:

(py2.7)user@ubuntu:~/Workspace/trachacks.git/estimationtoolsplugin/trunk$ python setup.py test

There are other ways to execute unit tests, but some code needs to be added.

Last edited 5 months ago by rjollos (previous) (diff)

comment:2 Changed 5 months ago by rjollos

In 13940:

0.4.7: Allow unit tests in each module to be executed using:

python -m estimationtools.tests.__init__
python -m estimationtools.tests.burndownchart
python -m estimationtools.tests.hoursremaining
python -m estimationtools.tests.utils
python -m estimationtools.tests.workloadchart

Fixed several failing unit tests. There are two unit tests that still fail. Refs #11778.

Add Comment

Modify Ticket

Action
as new The owner will remain hoessler.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.