Modify

Opened 10 years ago

Last modified 10 years ago

#11778 new enhancement

How do you invoke tests?

Reported by: Chris Nelson Owned by: Joachim 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 10 years ago by Ryan J Ollos

From the root directory you can execute:

(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.

Version 0, edited 10 years ago by Ryan J Ollos (next)

comment:2 Changed 10 years ago by Ryan J Ollos

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.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as new The owner will remain Joachim Hoessler.

Add Comment


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

 
Note: See TracTickets for help on using tickets.