skip pathlib support for python < 3.6

support-stringio-objects
Andrew Port 2022-06-05 21:17:28 -07:00
parent 356d86df78
commit d3a66f0bbd
1 changed files with 5 additions and 6 deletions

View File

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