Skip to content

Commit 3732e79

Browse files
chrahuntxavfernandez
authored andcommitted
Remove normpath from tests.lib.path.Path.
1 parent 358e690 commit 3732e79

File tree

2 files changed

+7
-10
lines changed

2 files changed

+7
-10
lines changed

tests/lib/__init__.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -302,14 +302,16 @@ def assert_installed(self, pkg_name, editable=True, with_files=[],
302302
sorted(self.files_created.keys())))
303303

304304
for f in with_files:
305-
if not (pkg_dir / f).normpath in self.files_created:
305+
normalized_path = os.path.normpath(pkg_dir / f)
306+
if normalized_path not in self.files_created:
306307
raise TestFailure(
307308
'Package directory %r missing expected content %r' %
308309
(pkg_dir, f)
309310
)
310311

311312
for f in without_files:
312-
if (pkg_dir / f).normpath in self.files_created:
313+
normalized_path = os.path.normpath(pkg_dir / f)
314+
if normalized_path in self.files_created:
313315
raise TestFailure(
314316
'Package directory %r has unexpected content %f' %
315317
(pkg_dir, f)
@@ -424,7 +426,9 @@ def __init__(self, base_path, *args, **kwargs):
424426
)
425427
if sys.platform == 'win32':
426428
if sys.version_info >= (3, 5):
427-
scripts_base = self.user_site_path.joinpath('..').normpath
429+
scripts_base = Path(
430+
os.path.normpath(self.user_site_path.joinpath('..'))
431+
)
428432
else:
429433
scripts_base = self.user_base_path
430434
self.user_bin_path = scripts_base.joinpath('Scripts')

tests/lib/path.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -137,13 +137,6 @@ def resolve(self):
137137
"""
138138
return Path(os.path.realpath(self))
139139

140-
@property
141-
def normpath(self):
142-
"""
143-
'/home/x/.././a//bc.d' -> '/home/a/bc.d'
144-
"""
145-
return Path(os.path.normpath(self))
146-
147140
@property
148141
def parent(self):
149142
"""

0 commit comments

Comments
 (0)