Drop '__main__' from tests
Direct test invocation doesn't work reliably across all environments. Using 'nosetests $FILE' is much more efficient.
This commit is contained in:
parent
007ffcf2e7
commit
28c31a913f
@ -24,6 +24,3 @@ find_and_load_cases(Bootstrap3ThemeTestCase,
|
|||||||
less_dir='bootstrap3/less',
|
less_dir='bootstrap3/less',
|
||||||
less_files=['theme'],
|
less_files=['theme'],
|
||||||
css_dir='bootstrap3/css')
|
css_dir='bootstrap3/css')
|
||||||
|
|
||||||
if __name__ == "__main__":
|
|
||||||
unittest.main()
|
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
"""
|
"""
|
||||||
lesscpy tests.
|
lesscpy color tests.
|
||||||
"""
|
"""
|
||||||
import unittest
|
import unittest
|
||||||
|
|
||||||
from lesscpy.lessc import color
|
from lesscpy.lessc import color
|
||||||
|
|
||||||
|
|
||||||
class TestLessColor(unittest.TestCase):
|
class TestLessColor(unittest.TestCase):
|
||||||
|
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
self.color = color.Color()
|
self.color = color.Color()
|
||||||
|
|
||||||
@ -182,6 +182,3 @@ class TestLessColor(unittest.TestCase):
|
|||||||
|
|
||||||
]:
|
]:
|
||||||
self.assertEqual(test(c, p), v, v)
|
self.assertEqual(test(c, p), v, v)
|
||||||
|
|
||||||
if __name__ == '__main__':
|
|
||||||
unittest.main()
|
|
||||||
|
@ -1,4 +1,8 @@
|
|||||||
|
"""
|
||||||
|
lesscpy expression tests.
|
||||||
|
"""
|
||||||
import unittest
|
import unittest
|
||||||
|
|
||||||
from lesscpy.plib.expression import Expression
|
from lesscpy.plib.expression import Expression
|
||||||
|
|
||||||
|
|
||||||
@ -52,7 +56,3 @@ class TestExpression(unittest.TestCase):
|
|||||||
]:
|
]:
|
||||||
e = Expression(test[:3])
|
e = Expression(test[:3])
|
||||||
self.assertEqual(test[3], e.parse(None), test)
|
self.assertEqual(test[3], e.parse(None), test)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
|
||||||
unittest.main()
|
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import unittest
|
import unittest
|
||||||
|
|
||||||
from lesscpy.lessc.scope import Scope
|
from lesscpy.lessc.scope import Scope
|
||||||
from lesscpy.plib.identifier import Identifier
|
from lesscpy.plib.identifier import Identifier
|
||||||
|
|
||||||
@ -98,6 +99,3 @@ class TestIdentifier(unittest.TestCase):
|
|||||||
t, r = i
|
t, r = i
|
||||||
id = Identifier(t, 0)
|
id = Identifier(t, 0)
|
||||||
self.assertEqual(id.parse(sc).fmt(fl), r, i)
|
self.assertEqual(id.parse(sc).fmt(fl), r, i)
|
||||||
|
|
||||||
if __name__ == '__main__':
|
|
||||||
unittest.main()
|
|
||||||
|
@ -14,6 +14,3 @@ find_and_load_cases(IssuesTestCase,
|
|||||||
less_dir='less/issues',
|
less_dir='less/issues',
|
||||||
css_dir='css/issues',
|
css_dir='css/issues',
|
||||||
css_minimized=False)
|
css_minimized=False)
|
||||||
|
|
||||||
if __name__ == "__main__":
|
|
||||||
unittest.main()
|
|
||||||
|
@ -13,6 +13,3 @@ class LessTestCase(unittest.TestCase):
|
|||||||
find_and_load_cases(LessTestCase,
|
find_and_load_cases(LessTestCase,
|
||||||
less_dir='less',
|
less_dir='less',
|
||||||
css_dir='css')
|
css_dir='css')
|
||||||
|
|
||||||
if __name__ == "__main__":
|
|
||||||
unittest.main()
|
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import unittest
|
import unittest
|
||||||
|
|
||||||
import lesscpy.lessc.utility as utility
|
import lesscpy.lessc.utility as utility
|
||||||
|
|
||||||
|
|
||||||
@ -102,7 +103,3 @@ class TestUtility(unittest.TestCase):
|
|||||||
self.assertEqual(3.0, test(10.0 / 3, 0))
|
self.assertEqual(3.0, test(10.0 / 3, 0))
|
||||||
self.assertEqual(4, test(3.5))
|
self.assertEqual(4, test(3.5))
|
||||||
self.assertEqual(4, test(4.5))
|
self.assertEqual(4, test(4.5))
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
|
||||||
unittest.main()
|
|
||||||
|
Loading…
Reference in New Issue
Block a user