Browse files

use standard unittest python >= 2.7

  • Loading branch information...
1 parent c199892 commit 2a6b4dede84d2de50d681df012f268f5e832d9ee @sigma sigma committed Oct 30, 2010
Showing with 30 additions and 8 deletions.
  1. +10 −4 setup.py
  2. +4 −0 tests/base.py
  3. +1 −1 tests/test_echo.py
  4. +1 −1 tests/test_getallplugins.py
  5. +14 −2 tox.ini
View
14 setup.py
@@ -1,9 +1,15 @@
from setuptools import setup, find_packages
import os
+import sys
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
+if sys.version_info < (2, 7):
+ setup_requires_version = ['unittest2']
+else:
+ setup_requires_version = []
+
setup(
name = "vmw.vco",
version = "0.3.1",
@@ -16,10 +22,10 @@ def read(fname):
'setuptools',
'zope.interface',
],
- extra_requires = {'async': 'Twisted'},
- setup_requires = ['unittest2',
- 'sphinx',
- ],
+ extra_requires = {'async': 'Twisted',
+ 'doc': 'sphinx'},
+ setup_requires = ['jinja2',
+ ] + setup_requires_version,
description = "Python bindings for the VMware Orchestrator",
long_description=read('README'),
View
4 tests/base.py
@@ -0,0 +1,4 @@
+try:
+ from unittest2 import *
+except ImportError:
+ from unittest import *
View
2 tests/test_echo.py
@@ -1,5 +1,5 @@
from mock_transports import TransportFactory
-from unittest2 import TestCase
+from base import TestCase
from xml.sax.saxutils import escape as xml_escape
from vmw.vco.client import Client
View
2 tests/test_getallplugins.py
@@ -1,5 +1,5 @@
from mock_transports import TransportFactory
-from unittest2 import TestCase
+from base import TestCase
import sys
from vmw.vco.client import Client, Plugin
View
16 tox.ini
@@ -1,9 +1,21 @@
[tox]
-envlist = py25, py26, py27
+envlist = py25, py26, py27, py31
[testenv]
commands=
unit2 discover -v []
deps=
- sphinx
+ jinja2
unittest2
+
+[testenv:py27]
+commands=
+ python -m unittest discover -v []
+deps=
+ jinja2
+
+[testenv:py31]
+commands=
+ python -m unittest discover -v []
+deps=
+ jinja2

0 comments on commit 2a6b4de

Please sign in to comment.