summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.coverage.ini3
-rw-r--r--.gitignore4
-rw-r--r--.travis.yml15
-rw-r--r--tests/test_bugs.py7
-rw-r--r--tests/test_dnssec.py5
-rw-r--r--tests/test_exceptions.py5
-rw-r--r--tests/test_flags.py5
-rw-r--r--tests/test_generate.py5
-rw-r--r--tests/test_grange.py5
-rw-r--r--tests/test_message.py5
-rw-r--r--tests/test_name.py5
-rw-r--r--tests/test_namedict.py5
-rw-r--r--tests/test_ntoaaton.py5
-rw-r--r--tests/test_rdata.py5
-rw-r--r--tests/test_rdtypeandclass.py5
-rw-r--r--tests/test_rdtypeanydnskey.py5
-rw-r--r--tests/test_rdtypeanyeui.py5
-rw-r--r--tests/test_rdtypeanyloc.py5
-rw-r--r--tests/test_resolver.py5
-rw-r--r--tests/test_rrset.py5
-rw-r--r--tests/test_set.py5
-rw-r--r--tests/test_update.py5
-rw-r--r--tests/test_zone.py5
-rw-r--r--tests/utest.py5
-rw-r--r--tox.ini46
25 files changed, 152 insertions, 23 deletions
diff --git a/.coverage.ini b/.coverage.ini
new file mode 100644
index 0000000..1414ca6
--- /dev/null
+++ b/.coverage.ini
@@ -0,0 +1,3 @@
+[run]
+branch = True
+source = dns
diff --git a/.gitignore b/.gitignore
index ae6319f..bb7767c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -6,3 +6,7 @@ html.zip
html.tar.gz
tests/*.out
*.pyc
+.coverage
+.tox
+dnspython.egg-info/
+.eggs/
diff --git a/.travis.yml b/.travis.yml
index 1baa893..977af17 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,4 +1,17 @@
language: python
python:
+ - "2.6"
- "2.7"
-script: make test
+ # 3.2 make unicode literal handling difficult.
+ # we dropped that, see https://github.com/rthalley/dnspython/pull/148
+ # for comments
+ #- "3.2"
+ - "3.3"
+ - "3.4"
+ - "3.5"
+ - "3.5-dev" # 3.5 development branch
+ - "nightly" # currently points to 3.6-dev
+install:
+ - pip install unittest2
+script:
+ - make test
diff --git a/tests/test_bugs.py b/tests/test_bugs.py
index bb482e7..5d9d58b 100644
--- a/tests/test_bugs.py
+++ b/tests/test_bugs.py
@@ -13,8 +13,11 @@
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
# OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-import cStringIO
-import unittest
+from six import BytesIO
+try:
+ import unittest2 as unittest
+except ImportError:
+ import unittest
import dns.rdata
import dns.rdataclass
diff --git a/tests/test_dnssec.py b/tests/test_dnssec.py
index cbbd3e2..64e6638 100644
--- a/tests/test_dnssec.py
+++ b/tests/test_dnssec.py
@@ -13,7 +13,10 @@
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
# OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-import unittest
+try:
+ import unittest2 as unittest
+except ImportError:
+ import unittest
import dns.dnssec
import dns.name
diff --git a/tests/test_exceptions.py b/tests/test_exceptions.py
index 90a6af4..8d04cc2 100644
--- a/tests/test_exceptions.py
+++ b/tests/test_exceptions.py
@@ -14,7 +14,10 @@
# OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
import binascii
-import unittest
+try:
+ import unittest2 as unittest
+except ImportError:
+ import unittest
from dns.exception import DNSException
diff --git a/tests/test_flags.py b/tests/test_flags.py
index b3cf671..881ac5c 100644
--- a/tests/test_flags.py
+++ b/tests/test_flags.py
@@ -13,7 +13,10 @@
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
# OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-import unittest
+try:
+ import unittest2 as unittest
+except ImportError:
+ import unittest
import dns.flags
import dns.rcode
diff --git a/tests/test_generate.py b/tests/test_generate.py
index 43c5f9a..d3bb2ee 100644
--- a/tests/test_generate.py
+++ b/tests/test_generate.py
@@ -19,7 +19,10 @@ sys.path.insert(0, '../') # Force the local project to be *the* dns
import cStringIO
import filecmp
import os
-import unittest
+try:
+ import unittest2 as unittest
+except ImportError:
+ import unittest
import dns.exception
import dns.rdata
diff --git a/tests/test_grange.py b/tests/test_grange.py
index 1bb7dbb..4ffe26d 100644
--- a/tests/test_grange.py
+++ b/tests/test_grange.py
@@ -19,7 +19,10 @@ sys.path.insert(0, '../')
import cStringIO
import filecmp
import os
-import unittest
+try:
+ import unittest2 as unittest
+except ImportError:
+ import unittest
import dns
import dns.exception
diff --git a/tests/test_message.py b/tests/test_message.py
index 931bb19..8dcdf0e 100644
--- a/tests/test_message.py
+++ b/tests/test_message.py
@@ -15,7 +15,10 @@
import cStringIO
import os
-import unittest
+try:
+ import unittest2 as unittest
+except ImportError:
+ import unittest
import dns.exception
import dns.message
diff --git a/tests/test_name.py b/tests/test_name.py
index 894a1a4..2c00063 100644
--- a/tests/test_name.py
+++ b/tests/test_name.py
@@ -13,7 +13,10 @@
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
# OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-import unittest
+try:
+ import unittest2 as unittest
+except ImportError:
+ import unittest
import cStringIO
import socket
diff --git a/tests/test_namedict.py b/tests/test_namedict.py
index e256bfe..d17d11d 100644
--- a/tests/test_namedict.py
+++ b/tests/test_namedict.py
@@ -13,7 +13,10 @@
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
# OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-import unittest
+try:
+ import unittest2 as unittest
+except ImportError:
+ import unittest
import dns.name
import dns.namedict
diff --git a/tests/test_ntoaaton.py b/tests/test_ntoaaton.py
index 5e33a92..bad0917 100644
--- a/tests/test_ntoaaton.py
+++ b/tests/test_ntoaaton.py
@@ -13,7 +13,10 @@
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
# OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-import unittest
+try:
+ import unittest2 as unittest
+except ImportError:
+ import unittest
import dns.exception
import dns.ipv4
diff --git a/tests/test_rdata.py b/tests/test_rdata.py
index 69e64e1..fbf11b3 100644
--- a/tests/test_rdata.py
+++ b/tests/test_rdata.py
@@ -13,7 +13,10 @@
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
# OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-import unittest
+try:
+ import unittest2 as unittest
+except ImportError:
+ import unittest
import dns.rdata
import dns.rdataclass
diff --git a/tests/test_rdtypeandclass.py b/tests/test_rdtypeandclass.py
index f3c0628..efdac07 100644
--- a/tests/test_rdtypeandclass.py
+++ b/tests/test_rdtypeandclass.py
@@ -13,7 +13,10 @@
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
# OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-import unittest
+try:
+ import unittest2 as unittest
+except ImportError:
+ import unittest
import dns.rdataclass
import dns.rdatatype
diff --git a/tests/test_rdtypeanydnskey.py b/tests/test_rdtypeanydnskey.py
index d9e40d7..c99cfe5 100644
--- a/tests/test_rdtypeanydnskey.py
+++ b/tests/test_rdtypeanydnskey.py
@@ -14,7 +14,10 @@
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
# OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-import unittest
+try:
+ import unittest2 as unittest
+except ImportError:
+ import unittest
import dns.rrset
import dns.rdtypes.ANY.DNSKEY
diff --git a/tests/test_rdtypeanyeui.py b/tests/test_rdtypeanyeui.py
index 800d103..e7ad862 100644
--- a/tests/test_rdtypeanyeui.py
+++ b/tests/test_rdtypeanyeui.py
@@ -14,7 +14,10 @@
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
# OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-import unittest
+try:
+ import unittest2 as unittest
+except ImportError:
+ import unittest
try:
from StringIO import StringIO
except ImportError:
diff --git a/tests/test_rdtypeanyloc.py b/tests/test_rdtypeanyloc.py
index 8d9838c..5cd8c70 100644
--- a/tests/test_rdtypeanyloc.py
+++ b/tests/test_rdtypeanyloc.py
@@ -14,7 +14,10 @@
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
# OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-import unittest
+try:
+ import unittest2 as unittest
+except ImportError:
+ import unittest
import dns.rrset
import dns.rdtypes.ANY.LOC
diff --git a/tests/test_resolver.py b/tests/test_resolver.py
index 6be955b..90e0f15 100644
--- a/tests/test_resolver.py
+++ b/tests/test_resolver.py
@@ -17,7 +17,10 @@ import cStringIO
import select
import sys
import time
-import unittest
+try:
+ import unittest2 as unittest
+except ImportError:
+ import unittest
import dns.name
import dns.message
diff --git a/tests/test_rrset.py b/tests/test_rrset.py
index be1324b..af6d8df 100644
--- a/tests/test_rrset.py
+++ b/tests/test_rrset.py
@@ -13,7 +13,10 @@
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
# OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-import unittest
+try:
+ import unittest2 as unittest
+except ImportError:
+ import unittest
import dns.rrset
diff --git a/tests/test_set.py b/tests/test_set.py
index 583d20c..ef42697 100644
--- a/tests/test_set.py
+++ b/tests/test_set.py
@@ -13,7 +13,10 @@
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
# OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-import unittest
+try:
+ import unittest2 as unittest
+except ImportError:
+ import unittest
import dns.set
diff --git a/tests/test_update.py b/tests/test_update.py
index 92ddb56..3e888ba 100644
--- a/tests/test_update.py
+++ b/tests/test_update.py
@@ -13,7 +13,10 @@
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
# OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-import unittest
+try:
+ import unittest2 as unittest
+except ImportError:
+ import unittest
import dns.update
import dns.rdata
diff --git a/tests/test_zone.py b/tests/test_zone.py
index 3b7c855..e4dd76b 100644
--- a/tests/test_zone.py
+++ b/tests/test_zone.py
@@ -16,7 +16,10 @@
import cStringIO
import filecmp
import os
-import unittest
+try:
+ import unittest2 as unittest
+except ImportError:
+ import unittest
import dns.exception
import dns.rdata
diff --git a/tests/utest.py b/tests/utest.py
index 3a217a1..d02fe41 100644
--- a/tests/utest.py
+++ b/tests/utest.py
@@ -1,6 +1,9 @@
import os.path
import sys
-import unittest
+try:
+ import unittest2 as unittest
+except ImportError:
+ import unittest
if __name__ == '__main__':
sys.path.insert(0, os.path.realpath('..'))
diff --git a/tox.ini b/tox.ini
new file mode 100644
index 0000000..3d195d7
--- /dev/null
+++ b/tox.ini
@@ -0,0 +1,46 @@
+[tox]
+envlist =
+ py26,
+ py27,
+ py30,
+ py31,
+ py32,
+ py33,
+ py34,
+# py35,
+ flake8,
+# pylint,
+ coverage
+
+[testenv]
+
+commands=
+ python setup.py test
+
+deps=
+
+[testenv:py26]
+deps =
+ unittest2
+
+
+[testenv:flake8]
+commands =
+ pip install flake8
+ flake8 dns
+
+[testenv:coverage]
+basepython = python2
+
+deps =
+ coverage
+
+commands =
+ python setup.py install
+ coverage run --rcfile=.coverage.ini setup.py test
+ coverage report
+
+[pep8]
+show-pep8 = True
+show-source = True
+