Remove normpath from tests.lib.path.Path.

This commit is contained in:
Chris Hunt 2019-07-19 21:28:22 -04:00 committed by Xavier Fernandez
parent 358e690c54
commit 3732e791a5
2 changed files with 7 additions and 10 deletions

View File

@ -302,14 +302,16 @@ class TestPipResult(object):
sorted(self.files_created.keys()))) sorted(self.files_created.keys())))
for f in with_files: for f in with_files:
if not (pkg_dir / f).normpath in self.files_created: normalized_path = os.path.normpath(pkg_dir / f)
if normalized_path not in self.files_created:
raise TestFailure( raise TestFailure(
'Package directory %r missing expected content %r' % 'Package directory %r missing expected content %r' %
(pkg_dir, f) (pkg_dir, f)
) )
for f in without_files: for f in without_files:
if (pkg_dir / f).normpath in self.files_created: normalized_path = os.path.normpath(pkg_dir / f)
if normalized_path in self.files_created:
raise TestFailure( raise TestFailure(
'Package directory %r has unexpected content %f' % 'Package directory %r has unexpected content %f' %
(pkg_dir, f) (pkg_dir, f)
@ -424,7 +426,9 @@ class PipTestEnvironment(TestFileEnvironment):
) )
if sys.platform == 'win32': if sys.platform == 'win32':
if sys.version_info >= (3, 5): if sys.version_info >= (3, 5):
scripts_base = self.user_site_path.joinpath('..').normpath scripts_base = Path(
os.path.normpath(self.user_site_path.joinpath('..'))
)
else: else:
scripts_base = self.user_base_path scripts_base = self.user_base_path
self.user_bin_path = scripts_base.joinpath('Scripts') self.user_bin_path = scripts_base.joinpath('Scripts')

View File

@ -137,13 +137,6 @@ class Path(_base):
""" """
return Path(os.path.realpath(self)) return Path(os.path.realpath(self))
@property
def normpath(self):
"""
'/home/x/.././a//bc.d' -> '/home/a/bc.d'
"""
return Path(os.path.normpath(self))
@property @property
def parent(self): def parent(self):
""" """