Skip to content

Commit

Permalink
Added dependency check (against nose)
Browse files Browse the repository at this point in the history
  • Loading branch information
Bruno Bord committed Dec 3, 2008
1 parent e212b33 commit 61782fc
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
4 changes: 3 additions & 1 deletion README.md
Expand Up @@ -68,7 +68,8 @@ with a total archive of more than 100MB.
[ ] Extend the test utilities to other languages
[ ] Add an "ignore" option to ignore other files (logs, sqlite database,
image files, etc)
[ ] Check the only default dependency: ``nosetests``.
[ ] Check other pythonic dependencies (django, py.test). Won't be possible
for non-python test-programs, though

### Done

Expand All @@ -85,4 +86,5 @@ with a total archive of more than 100MB.
[X] OBSOLETE: Add the possibility to run a custom command.
(eg. ``python manage.py test myapp.MyTest``)
[X] Erase the custom command option. Too dangerous
[X] Check the only default dependency: ``nosetests``.

11 changes: 11 additions & 0 deletions tdaemon.py
Expand Up @@ -10,6 +10,7 @@
file for more details.
"""


import sys
import os
from stat import *
Expand Down Expand Up @@ -47,6 +48,8 @@ def __init__(self, file_path, test_program, debug=False):
self.file_list = self.walk(file_path)
self.test_program = test_program

self.check_dependencies()

self.debug = debug

def check_configuration(self, file_path, test_program):
Expand All @@ -58,6 +61,14 @@ def check_configuration(self, file_path, test_program):
os.path.abspath(file_path)
)

def check_dependencies(self):
"Checks if the test program is available in the python environnement"
if self.test_program == 'nose':
try:
import nose
except ImportError:
sys.exit('Nosetests is not available on your system.'
' Please install it and try to run it again')

def include(self, path):
"""Returns `True` if the file is not ignored"""
Expand Down

0 comments on commit 61782fc

Please sign in to comment.