Prepare for tests.

This doesn't add any actual tests but it should pave the way for that.  Tests
may be run like so:

{{{
python setup.py nosetests --with-coverage
}}}
This commit is contained in:
Lance Edgar 2013-06-19 08:03:42 -07:00
parent 844856f425
commit 4f34e6dddc
4 changed files with 37 additions and 1 deletions

View file

@ -28,11 +28,19 @@
import sys import sys
import os.path import os.path
import pyinotify
import threading import threading
import Queue import Queue
import logging import logging
try:
import pyinotify
except ImportError:
# Mock out for testing on Windows.
class Dummy(object):
pass
pyinotify = Dummy()
pyinotify.ProcessEvent = Dummy
import edbob import edbob
from edbob.daemon import Daemon from edbob.daemon import Daemon
from edbob.errors import email_exception from edbob.errors import email_exception

19
rattail/tests/__init__.py Normal file
View file

@ -0,0 +1,19 @@
import unittest
from pyramid import testing
class TestCase(unittest.TestCase):
"""
Base class for all test suites.
"""
def setUp(self):
self.config = testing.setUp()
def tearDown(self):
testing.tearDown()
def test_something(self):
self.assertTrue(1)

7
setup.cfg Normal file
View file

@ -0,0 +1,7 @@
[nosetests]
nocapture = 1
cover-package = rattail
cover-erase = 1
cover-inclusive = 1
cover-html = 1
cover-html-dir = htmlcov

View file

@ -94,6 +94,8 @@ setup(
], ],
install_requires = requires, install_requires = requires,
tests_require = requires + ['nose', 'coverage'],
test_suite = 'nose.collector',
namespace_packages = ['rattail'], namespace_packages = ['rattail'],
packages = find_packages(), packages = find_packages(),