Skip to content

Remove normpath from tests.lib.path.Path. #6747

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 20, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions tests/lib/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -299,14 +299,16 @@ def assert_installed(self, pkg_name, editable=True, with_files=[],
sorted(self.files_created.keys())))

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(
'Package directory %r missing expected content %r' %
(pkg_dir, f)
)

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(
'Package directory %r has unexpected content %f' %
(pkg_dir, f)
Expand Down Expand Up @@ -421,7 +423,9 @@ def __init__(self, base_path, *args, **kwargs):
)
if sys.platform == 'win32':
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:
scripts_base = self.user_base_path
self.user_bin_path = scripts_base.joinpath('Scripts')
Expand Down
7 changes: 0 additions & 7 deletions tests/lib/path.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,13 +137,6 @@ def resolve(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
def parent(self):
"""
Expand Down