Skip to content

Commit

Permalink
Drop '__main__' from tests
Browse files Browse the repository at this point in the history
Direct test invocation doesn't work reliably across all environments.
Using 'nosetests $FILE' is much more efficient.
  • Loading branch information
saschpe committed Feb 2, 2014
1 parent 007ffcf commit 28c31a9
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 25 deletions.
3 changes: 0 additions & 3 deletions test/test_bootstrap3.py
Expand Up @@ -24,6 +24,3 @@ class Bootstrap3ThemeTestCase(unittest.TestCase):
less_dir='bootstrap3/less',
less_files=['theme'],
css_dir='bootstrap3/css')

if __name__ == "__main__":
unittest.main()
7 changes: 2 additions & 5 deletions test/test_color.py
@@ -1,12 +1,12 @@
"""
lesscpy tests.
lesscpy color tests.
"""
import unittest

from lesscpy.lessc import color


class TestLessColor(unittest.TestCase):

def setUp(self):
self.color = color.Color()

Expand Down Expand Up @@ -182,6 +182,3 @@ def test_spin(self):

]:
self.assertEqual(test(c, p), v, v)

if __name__ == '__main__':
unittest.main()
8 changes: 4 additions & 4 deletions test/test_expression.py
@@ -1,4 +1,8 @@
"""
lesscpy expression tests.
"""
import unittest

from lesscpy.plib.expression import Expression


Expand Down Expand Up @@ -52,7 +56,3 @@ def test_op(self):
]:
e = Expression(test[:3])
self.assertEqual(test[3], e.parse(None), test)


if __name__ == '__main__':
unittest.main()
4 changes: 1 addition & 3 deletions test/test_identifier.py
@@ -1,4 +1,5 @@
import unittest

from lesscpy.lessc.scope import Scope
from lesscpy.plib.identifier import Identifier

Expand Down Expand Up @@ -98,6 +99,3 @@ def test_media(self):
t, r = i
id = Identifier(t, 0)
self.assertEqual(id.parse(sc).fmt(fl), r, i)

if __name__ == '__main__':
unittest.main()
3 changes: 0 additions & 3 deletions test/test_issues.py
Expand Up @@ -14,6 +14,3 @@ class IssuesTestCase(unittest.TestCase):
less_dir='less/issues',
css_dir='css/issues',
css_minimized=False)

if __name__ == "__main__":
unittest.main()
3 changes: 0 additions & 3 deletions test/test_less.py
Expand Up @@ -13,6 +13,3 @@ class LessTestCase(unittest.TestCase):
find_and_load_cases(LessTestCase,
less_dir='less',
css_dir='css')

if __name__ == "__main__":
unittest.main()
5 changes: 1 addition & 4 deletions test/test_utility.py
@@ -1,4 +1,5 @@
import unittest

import lesscpy.lessc.utility as utility


Expand Down Expand Up @@ -102,7 +103,3 @@ def test_convergent_round(self):
self.assertEqual(3.0, test(10.0 / 3, 0))
self.assertEqual(4, test(3.5))
self.assertEqual(4, test(4.5))


if __name__ == '__main__':
unittest.main()

0 comments on commit 28c31a9

Please sign in to comment.