Skipping tests on windows where NameTemporaryFile is used.

Should go back and revisit this, see if something else can be done.
This commit is contained in:
John G Evans 2013-07-05 07:49:19 -04:00
commit 6c7cab5a47
2 changed files with 9 additions and 0 deletions

View file

@ -1,4 +1,5 @@
import doctest
import os
import tempfile
import xml.etree.cElementTree as ET
import unittest
@ -290,6 +291,8 @@ class TestXML(unittest.TestCase):
with self.assertRaises((IOError, OSError)) as ce:
xmlb = glymur.jp2box.XMLBox(filename=self.xmlfile, xml=xml_object)
@unittest.skipIf(os.name == "nt",
"Problems using NamedTemporaryFile on windows.")
def test_basic_xml(self):
# Should be able to write an XMLBox.
j2k = Jp2k(self.j2kfile)
@ -310,6 +313,8 @@ class TestXML(unittest.TestCase):
self.assertEqual(ET.tostring(jp2.box[3].xml),
b'<data>0</data>')
@unittest.skipIf(os.name == "nt",
"Problems using NamedTemporaryFile on windows.")
def test_xml_from_file(self):
j2k = Jp2k(self.j2kfile)
@ -354,6 +359,8 @@ class TestColourSpecificationBox(unittest.TestCase):
def tearDown(self):
pass
@unittest.skipIf(os.name == "nt",
"Problems using NamedTemporaryFile on windows.")
def test_color_specification_box_with_out_enumerated_colorspace(self):
j2k = Jp2k(self.j2kfile)

View file

@ -781,6 +781,8 @@ class TestPrinting(unittest.TestCase):
expected = '\n'.join(lines)
self.assertEqual(actual, expected)
@unittest.skipIf(os.name == "nt",
"Problems using NamedTemporaryFile on windows.")
def test_less_common_boxes(self):
with tempfile.NamedTemporaryFile(suffix='.jp2') as tfile:
with open(self.jp2file, 'rb') as ifile: