Permalink
Browse files

Packaged tests for running as a suite

Also added travis CI file and pip requirements.txt
  • Loading branch information...
joonty committed Dec 21, 2012
1 parent d102c7c commit 44f69d8b0be4ecbbecf6dbbd97b04a7029c9fd92
View
@@ -0,0 +1,9 @@
+language: python
+python:
+ - "2.6"
+ - "2.7"
+ - "3.2"
+# command to install dependencies
+install: "pip install -r requirements.txt --use-mirrors"
+# command to run tests
+script: vdebugtests
View
@@ -0,0 +1,2 @@
+unittest
+mock
@@ -1,5 +1,6 @@
-import sys
-sys.path.append('../plugin/python/')
+if __name__ == "__main__":
+ import sys
+ sys.path.append('../plugin/python/')
import unittest
import vdebug.breakpoint
import vdebug.util
View
@@ -1,5 +1,6 @@
-import sys
-sys.path.append('../plugin/python/')
+if __name__ == "__main__":
+ import sys
+ sys.path.append('../plugin/python/')
import unittest
import vdebug.dbgp
from mock import MagicMock, patch
@@ -1,5 +1,6 @@
-import sys
-sys.path.append('../plugin/python')
+if __name__ == "__main__":
+ import sys
+ sys.path.append('../plugin/python/')
import unittest
import vdebug.dbgp
@@ -1,5 +1,6 @@
-import sys
-sys.path.append('../plugin/python')
+if __name__ == "__main__":
+ import sys
+ sys.path.append('../plugin/python/')
import unittest
import vdebug.dbgp
import xml.etree.ElementTree as ET
@@ -1,5 +1,6 @@
-import sys
-sys.path.append('../plugin/python')
+if __name__ == "__main__":
+ import sys
+ sys.path.append('../plugin/python/')
import unittest
import vdebug.dbgp
import xml
@@ -198,8 +199,6 @@ class ContextGetAlternateTest(unittest.TestCase):
def test_properties_are_objects(self):
res = vdebug.dbgp.ContextGetResponse(self.response,"","",Mock())
context = res.get_context()
- p = context[0]
- print "Display name: "+p.display_name
assert len(context) == 3
self.assertIsInstance(context[0],vdebug.dbgp.ContextProperty)
@@ -1,5 +1,6 @@
-import sys
-sys.path.append('../plugin/python')
+if __name__ == "__main__":
+ import sys
+ sys.path.append('../plugin/python/')
import unittest
from vdebug.opts import Options,OptionsError
@@ -1,5 +1,6 @@
-import sys
-sys.path.append('../plugin/python')
+if __name__ == "__main__":
+ import sys
+ sys.path.append('../plugin/python/')
import unittest
""" Mock vim import """
import vdebug.opts
View
@@ -0,0 +1,12 @@
+import unittest
+import sys
+
+sys.path.append('tests')
+sys.path.append('plugin/python')
+vdebugLoader = unittest.TestLoader()
+suites = vdebugLoader.discover('tests','test_*.py')
+result = unittest.TextTestRunner().run(suites)
+if result.failures:
+ exit(1)
+elif result.errors:
+ exit(2)

0 comments on commit 44f69d8

Please sign in to comment.