Skip to content
Browse files

Moving to a module

  • Loading branch information...
1 parent 1f21569 commit fde7a083fbaaf540541b747762534ac20b352ad1 @coleifer committed Mar 28, 2012
Showing with 18 additions and 9 deletions.
  1. 0 micawber.py → micawber/__init__.py
  2. 0 { → micawber}/tests.py
  3. +11 −7 runtests.py
  4. +7 −2 setup.py
View
0 micawber.py → micawber/__init__.py
File renamed without changes.
View
0 tests.py → micawber/tests.py
File renamed without changes.
View
18 runtests.py
@@ -1,13 +1,17 @@
#!/usr/bin/env python
-import os
+import sys
import unittest
+from micawber import tests
-def collect():
- start_dir = os.path.abspath(os.path.dirname(__file__))
- return unittest.defaultTestLoader.discover(start_dir)
-
+def runtests(*test_args):
+ suite = unittest.TestLoader().loadTestsFromModule(tests)
+ result = unittest.TextTestRunner(verbosity=2).run(suite)
+ if result.failures:
+ sys.exit(1)
+ elif result.errors:
+ sys.exit(2)
+ sys.exit(0)
if __name__ == '__main__':
- unittest.main(module='tests')
-
+ runtests(*sys.argv[1:])
View
9 setup.py
@@ -13,14 +13,19 @@
author='Charles Leifer',
author_email='coleifer@gmail.com',
url='http://github.com/coleifer/micawber/',
- py_modules=['micawber'],
+ packages=find_packages(),
+ package_data = {
+ 'micawber': [
+ ],
+ },
classifiers=[
'Development Status :: 4 - Beta',
'Environment :: Web Environment',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Operating System :: OS Independent',
'Programming Language :: Python',
+ 'Framework :: Django',
],
- test_suite='runtests.collect',
+ test_suite='runtests.runtests',
)

0 comments on commit fde7a08

Please sign in to comment.
Something went wrong with that request. Please try again.