Skip to content

Commit 3db7ece

Browse files
committed
Remove normpath from tests.lib.path.Path.
1 parent 34621bf commit 3db7ece

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
@@ -299,14 +299,16 @@ def assert_installed(self, pkg_name, editable=True, with_files=[],
299299
sorted(self.files_created.keys())))
300300

301301
for f in with_files:
302-
if not (pkg_dir / f).normpath in self.files_created:
302+
normalized_path = os.path.normpath(pkg_dir / f)
303+
if normalized_path not in self.files_created:
303304
raise TestFailure(
304305
'Package directory %r missing expected content %r' %
305306
(pkg_dir, f)
306307
)
307308

308309
for f in without_files:
309-
if (pkg_dir / f).normpath in self.files_created:
310+
normalized_path = os.path.normpath(pkg_dir / f)
311+
if normalized_path in self.files_created:
310312
raise TestFailure(
311313
'Package directory %r has unexpected content %f' %
312314
(pkg_dir, f)
@@ -421,7 +423,9 @@ def __init__(self, base_path, *args, **kwargs):
421423
)
422424
if sys.platform == 'win32':
423425
if sys.version_info >= (3, 5):
424-
scripts_base = self.user_site_path.joinpath('..').normpath
426+
scripts_base = Path(
427+
os.path.normpath(self.user_site_path.joinpath('..'))
428+
)
425429
else:
426430
scripts_base = self.user_base_path
427431
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)