Skip to content

Commit

Permalink
added setup.py test
Browse files Browse the repository at this point in the history
  • Loading branch information
ojii committed Sep 21, 2012
1 parent f1bc078 commit 4112e2f
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 10 deletions.
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
*.pyc
dist
.*
*.egg-info
*.egg
*.xml
htmlcov
/*env*/
13 changes: 5 additions & 8 deletions runtests.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

ROOT_URLCONF = 'runtests'

def runtests():
def main():
from django.conf import settings
settings.configure(
INSTALLED_APPS = INSTALLED_APPS,
Expand All @@ -43,13 +43,10 @@ def runtests():
TestRunner = get_runner(settings)

test_runner = TestRunner(verbosity=1, interactive=False, failfast=False)
with warnings.catch_warnings():
warnings.simplefilter("ignore")
failures = test_runner.run_tests(['classytags'])
return failures
warnings.simplefilter("ignore")
failures = test_runner.run_tests(['classytags'])
sys.exit(failures)


if __name__ == "__main__":
failures = runtests()
if failures: # pragma: no cover
sys.exit(bool(failures))
main()
7 changes: 5 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@
url = 'http://github.com/ojii/django-classy-tags',
packages = find_packages(),
zip_safe=False,
test_suite='tests.suite',
install_requires=[
'Django>1.2',
],
test_suite='runtests.main',
classifiers=[
"Development Status :: 5 - Production/Stable",
"License :: OSI Approved :: BSD License",
Expand All @@ -27,4 +30,4 @@
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: Text Processing :: Markup :: HTML",
],
)
)

0 comments on commit 4112e2f

Please sign in to comment.