Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify test discovery using unittest discover command #58

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ python:
- "2.7"
- "3.5"
install: "pip install -r requirements.txt"
script: "python setup.py test"
script: "python -m unittest discover"
3 changes: 0 additions & 3 deletions htmlmin/tests/test_escape.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,3 @@ def test_ampersand_nonhex(self):

def test_proper_char_refs(self):
self.assertNoQuotes('π"4', 'π"4')

def suite():
return unittest.TestLoader().loadTestsFromTestCase(TestEscapeAttributes)
29 changes: 0 additions & 29 deletions htmlmin/tests/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -586,32 +586,3 @@ def test_middlware_keep_header(self):
],
' X Y ')
self.assertTrue(any((h == 'X-HTML-Min-Enable' for h, v in headers)))

def suite():
minify_function_suite = unittest.TestLoader().\
loadTestsFromTestCase(TestMinifyFunction)
minifier_object_suite = unittest.TestLoader().\
loadTestsFromTestCase(TestMinifierObject)
minify_features_suite = unittest.TestLoader().\
loadTestsFromTestCase(TestMinifyFeatures)
self_closing_tags_suite = unittest.TestLoader().\
loadTestsFromTestCase(TestSelfClosingTags)
self_opening_tags_suite = unittest.TestLoader().\
loadTestsFromTestCase(TestSelfOpeningTags)
decorator_suite = unittest.TestLoader().\
loadTestsFromTestCase(TestDecorator)
middleware_suite = unittest.TestLoader().\
loadTestsFromTestCase(TestMiddleware)
return unittest.TestSuite([
minify_function_suite,
minifier_object_suite,
minify_features_suite,
self_closing_tags_suite,
self_opening_tags_suite,
decorator_suite,
middleware_suite,
test_escape.suite(),
])

if __name__ == '__main__':
unittest.main()
2 changes: 0 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@
packages=find_packages(),
include_package_data=True,
zip_safe=True,
test_suite='htmlmin.tests.tests.suite',
install_requires=[],
tests_require=[],
classifiers=[
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
envlist=py27, py33, py34

[testenv]
commands=python setup.py test
commands=python -m unittest discover