skip pathlib support for python < 3.6
parent
356d86df78
commit
d3a66f0bbd
|
@ -4,10 +4,7 @@ from svgpathtools import *
|
||||||
from io import StringIO
|
from io import StringIO
|
||||||
from io import open # overrides build-in open for compatibility with python2
|
from io import open # overrides build-in open for compatibility with python2
|
||||||
from os.path import join, dirname
|
from os.path import join, dirname
|
||||||
try:
|
from sys import version_info
|
||||||
import pathlib
|
|
||||||
except ImportError:
|
|
||||||
import pathlib2 as pathlib
|
|
||||||
|
|
||||||
|
|
||||||
class TestDocument(unittest.TestCase):
|
class TestDocument(unittest.TestCase):
|
||||||
|
@ -19,6 +16,8 @@ class TestDocument(unittest.TestCase):
|
||||||
|
|
||||||
def test_from_file_path(self):
|
def test_from_file_path(self):
|
||||||
"""Test reading svg from file provided as path"""
|
"""Test reading svg from file provided as path"""
|
||||||
|
if version_info >= (3, 6):
|
||||||
|
import pathlib
|
||||||
doc = Document(pathlib.Path(__file__).parent / 'polygons.svg')
|
doc = Document(pathlib.Path(__file__).parent / 'polygons.svg')
|
||||||
|
|
||||||
self.assertEqual(len(doc.paths()), 2)
|
self.assertEqual(len(doc.paths()), 2)
|
||||||
|
|
Loading…
Reference in New Issue