Skip to content

Commit 48b0006

Browse files
authored
Run Structure and Behavior tests in Python 3 (#22)
Fix #21.
1 parent 8ab2b39 commit 48b0006

File tree

5 files changed

+12
-9
lines changed

5 files changed

+12
-9
lines changed

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ language: python
33
python:
44
- "2.7"
55
- "3.5"
6+
- "3.6"
67
- "nightly"
78
install: pip install tox-travis
89
script: tox

setup.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,6 @@
2020
packages=['fluent', 'fluent.syntax', 'fluent.migrate'],
2121
package_data={
2222
'fluent.migrate': ['cldr_data/*']
23-
}
24-
)
23+
},
24+
tests_require=['six']
25+
)

tests/syntax/test_behavior.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
from __future__ import unicode_literals
2+
from six import with_metaclass
3+
24
import os
35
import re
46
import sys
@@ -99,7 +101,5 @@ def test(self):
99101
return type.__new__(mcs, name, bases, attrs)
100102

101103

102-
class TestBehavior(unittest.TestCase):
104+
class TestBehavior(with_metaclass(TestBehaviorMeta, unittest.TestCase)):
103105
maxDiff = None
104-
105-
__metaclass__ = TestBehaviorMeta

tests/syntax/test_structure.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
from __future__ import unicode_literals
2+
from six import with_metaclass
3+
24
import os
35
import sys
46
import json
@@ -50,7 +52,5 @@ def test(self):
5052
return type.__new__(mcs, name, bases, attrs)
5153

5254

53-
class TestStructure(unittest.TestCase):
55+
class TestStructure(with_metaclass(TestStructureMeta, unittest.TestCase)):
5456
maxDiff = None
55-
56-
__metaclass__ = TestStructureMeta

tox.ini

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
[tox]
2-
envlist = py27, py27-cl, py36
2+
envlist = py27, py27-cl, py35, py36
33
skipsdist=True
44

55
[testenv]
66
setenv =
77
PYTHONPATH = {toxinidir}
88
deps =
9+
six
910
cl: compare-locales
1011

1112
commands=python -m unittest discover

0 commit comments

Comments
 (0)