From 6c7cab5a47dbad5d4ef850f40ddc3cc6beed4f75 Mon Sep 17 00:00:00 2001 From: John G Evans Date: Fri, 5 Jul 2013 07:49:19 -0400 Subject: [PATCH] Skipping tests on windows where NameTemporaryFile is used. Should go back and revisit this, see if something else can be done. --- glymur/test/test_jp2box.py | 7 +++++++ glymur/test/test_printing.py | 2 ++ 2 files changed, 9 insertions(+) diff --git a/glymur/test/test_jp2box.py b/glymur/test/test_jp2box.py index af85931..1fe5330 100644 --- a/glymur/test/test_jp2box.py +++ b/glymur/test/test_jp2box.py @@ -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'0') + @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) diff --git a/glymur/test/test_printing.py b/glymur/test/test_printing.py index 5b93e09..8b2e033 100644 --- a/glymur/test/test_printing.py +++ b/glymur/test/test_printing.py @@ -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: