Skip to content

Commit

Permalink
Fix tests for Jython 2.7b3
Browse files Browse the repository at this point in the history
  • Loading branch information
martinblech committed Jan 18, 2015
1 parent d5b41eb commit fb2738f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
8 changes: 4 additions & 4 deletions .travis.yml
Expand Up @@ -26,9 +26,9 @@ matrix:
env: JYTHON=true

before_install:
- export JYTHON_URL='http://search.maven.org/remotecontent?filepath=org/python/jython-installer/2.5.3/jython-installer-2.5.3.jar'
- if [ "$JYTHON" == "true" ]; then wget $JYTHON_URL -O jython_installer.jar; java -jar jython_installer.jar -s -d $HOME/jython; export PATH=$HOME/jython:$PATH; jython ez_setup.py; $HOME/jython/bin/easy_install nose coverage; fi
- export JYTHON_URL='http://search.maven.org/remotecontent?filepath=org/python/jython-installer/2.7-b3/jython-installer-2.7-b3.jar'
- if [ "$JYTHON" == "true" ]; then wget $JYTHON_URL -O jython_installer.jar; java -jar jython_installer.jar -s -d $HOME/jython; export PATH=$HOME/jython:$PATH; jython ez_setup.py; $HOME/jython/bin/easy_install nose; fi

before_script: if [ "$JYTHON" == "true" ]; then export NOSE=$HOME/jython/bin/nosetests; else export NOSE=nosetests; fi
before_script: if [ "$JYTHON" == "true" ]; then export NOSE=$HOME/jython/bin/nosetests NOSE_OPTIONS=""; else export NOSE=nosetests NOSE_OPTIONS="--with-coverage --cover-package=xmltodict"; fi

script: $NOSE --with-coverage --cover-package=xmltodict
script: $NOSE $NOSE_OPTIONS
6 changes: 5 additions & 1 deletion tests/test_dicttoxml.py
@@ -1,3 +1,4 @@
import sys
from xmltodict import parse, unparse, OrderedDict

try:
Expand All @@ -8,6 +9,8 @@
import collections
from textwrap import dedent

IS_JYTHON = sys.platform.startswith('java')

_HEADER_RE = re.compile(r'^[^\n]*\n')


Expand Down Expand Up @@ -88,7 +91,8 @@ def p(key, value):
self.assertEqual(_strip(unparse(obj, preprocessor=p)),
'<a><c>2</c></a>')

if hasattr(collections, 'OrderedDict'):
if hasattr(collections, 'OrderedDict') and not IS_JYTHON:
# Jython's SAX does not preserve attribute order
def test_attr_order_roundtrip(self):
xml = '<root a="1" b="2" c="3"></root>'
self.assertEqual(xml, _strip(unparse(parse(xml))))
Expand Down

0 comments on commit fb2738f

Please sign in to comment.