Merge pull request #41273 from lgeiger:fix-python35-test
PiperOrigin-RevId: 320624065 Change-Id: I4a95af39549380a4c7ff6cb861a197f44c9e34a5
This commit is contained in:
commit
b5a50ac950
@ -20,7 +20,6 @@ from __future__ import division
|
|||||||
from __future__ import print_function
|
from __future__ import print_function
|
||||||
|
|
||||||
import os.path
|
import os.path
|
||||||
import pathlib
|
|
||||||
|
|
||||||
from absl.testing import parameterized
|
from absl.testing import parameterized
|
||||||
import numpy as np
|
import numpy as np
|
||||||
@ -31,9 +30,19 @@ from tensorflow.python.platform import gfile
|
|||||||
from tensorflow.python.platform import test
|
from tensorflow.python.platform import test
|
||||||
|
|
||||||
|
|
||||||
|
class PathLike(object):
|
||||||
|
"""Backport of pathlib.Path for Python < 3.6"""
|
||||||
|
|
||||||
|
def __init__(self, name):
|
||||||
|
self.name = name
|
||||||
|
|
||||||
|
def __fspath__(self):
|
||||||
|
return self.name
|
||||||
|
|
||||||
|
|
||||||
run_all_path_types = parameterized.named_parameters(
|
run_all_path_types = parameterized.named_parameters(
|
||||||
("str", os.path.join),
|
("str", os.path.join),
|
||||||
("pathlib", lambda *paths: pathlib.Path(os.path.join(*paths))))
|
("pathlike", lambda *paths: PathLike(os.path.join(*paths))))
|
||||||
|
|
||||||
|
|
||||||
class FileIoTest(test.TestCase, parameterized.TestCase):
|
class FileIoTest(test.TestCase, parameterized.TestCase):
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user