[issue19873] There is a duplicate function in Lib/test/test_pathlib.py

2015-12-29 Thread NAVNEET SUMAN

NAVNEET SUMAN added the comment:

Thanks.. Finally after two years the patch got submitted. :D

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue19873] There is a duplicate function in Lib/test/test_pathlib.py

2015-12-28 Thread Ezio Melotti

Ezio Melotti added the comment:

Applied to default in 1472c08d9c23.
Thanks Navneet for the patch!

--
assignee: pitrou -> ezio.melotti
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
type: behavior -> enhancement
versions: +Python 3.6 -Python 3.5

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue19873] There is a duplicate function in Lib/test/test_pathlib.py

2015-12-28 Thread Ezio Melotti

Ezio Melotti added the comment:

As far as I understand the two functions exist only for readability (i.e. the 
intention is to check for relative and absolute resolution respectively), but 
since they share the same implementation, the patch defines a single function 
and uses it for both instead of duplicating the code.

--
assignee: pitrou -> ezio.melotti
stage: patch review -> commit review
versions: +Python 3.6 -Python 3.5

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue19873] There is a duplicate function in Lib/test/test_pathlib.py

2015-12-28 Thread R. David Murray

R. David Murray added the comment:

Maybe add a comment as to why this is done?  (I'm not sure I understand why.)

--
nosy: +r.david.murray

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue19873] There is a duplicate function in Lib/test/test_pathlib.py

2015-12-28 Thread R. David Murray

R. David Murray added the comment:

So maybe "# we can use the same method to check for both absolute and relative 
resolution"?

--
assignee: ezio.melotti -> pitrou
stage: commit review -> patch review
versions: +Python 3.5 -Python 3.6

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue19873] There is a duplicate function in Lib/test/test_pathlib.py

2015-12-22 Thread Joseph Gordon

Changes by Joseph Gordon :


--
nosy: +josephgordon

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue19873] There is a duplicate function in Lib/test/test_pathlib.py

2015-05-10 Thread Mark Lawrence

Mark Lawrence added the comment:

Can we have a formal commit review please as Jessica's comment in msg212966 
that the patch looked good was over one year ago.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19873
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue19873] There is a duplicate function in Lib/test/test_pathlib.py

2015-03-01 Thread Mark Lawrence

Mark Lawrence added the comment:

Pang :(

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19873
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue19873] There is a duplicate function in Lib/test/test_pathlib.py

2014-06-12 Thread Mark Lawrence

Mark Lawrence added the comment:

ping.

--
nosy: +BreamoreBoy

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19873
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue19873] There is a duplicate function in Lib/test/test_pathlib.py

2014-03-17 Thread Éric Araujo

Changes by Éric Araujo mer...@netwok.org:


--
assignee:  - pitrou

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19873
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue19873] There is a duplicate function in Lib/test/test_pathlib.py

2014-03-09 Thread Jessica McKellar

Jessica McKellar added the comment:

Thanks for the patch, NAVNEET.SUMAN!

The patch implements ezio.melotti's proposal and applies cleanly without test 
regressions for me locally.

= patch review

--
nosy: +jesstess
stage: needs patch - patch review

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19873
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue19873] There is a duplicate function in Lib/test/test_pathlib.py

2014-02-25 Thread NAVNEET SUMAN

NAVNEET SUMAN added the comment:

made patch according to Ezio Melotti

--
keywords: +patch
nosy: +NAVNEET.SUMAN
Added file: http://bugs.python.org/file34224/remover_duplicate_function.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19873
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue19873] There is a duplicate function in Lib/test/test_pathlib.py

2014-02-15 Thread Ezio Melotti

Ezio Melotti added the comment:

I agree that two functions with different names and same code seem confusing.
I think replacing them with _check_resolve (and possibly add 
_check_resolve_relative = _check_resolve_absolute = _check_resolve) would be OK.
Antoine, if you disagree, feel free to close this issue (or suggest something 
else).

--
keywords: +easy
nosy: +ezio.melotti
stage:  - needs patch
versions: +Python 3.5 -Python 3.4

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19873
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue19873] There is a duplicate function in Lib/test/test_pathlib.py

2013-12-03 Thread Vajrasky Kok

New submission from Vajrasky Kok:

Here it is (Lib/test/test_pathlib.py, line 1240):

def _check_resolve_relative(self, p, expected):
q = p.resolve()
self.assertEqual(q, expected)

def _check_resolve_absolute(self, p, expected):
q = p.resolve()
self.assertEqual(q, expected)

--
components: Tests
messages: 205082
nosy: pitrou, vajrasky
priority: normal
severity: normal
status: open
title: There is a duplicate function in Lib/test/test_pathlib.py
type: behavior
versions: Python 3.4

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19873
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue19873] There is a duplicate function in Lib/test/test_pathlib.py

2013-12-03 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Well, it's not really a duplicate function (the code is the same, but the 
intent is different). I'm not sure it's worth deduplicating.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19873
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue19873] There is a duplicate function in Lib/test/test_pathlib.py

2013-12-03 Thread Vajrasky Kok

Vajrasky Kok added the comment:

These functions are only being used in test_resolve_common.

def test_resolve_common(self):
P = self.cls
p = P(BASE, 'foo')
with self.assertRaises(OSError) as cm:
p.resolve()
self.assertEqual(cm.exception.errno, errno.ENOENT)
# These are all relative symlinks
p = P(BASE, 'dirB', 'fileB')
self._check_resolve_relative(p, p)
p = P(BASE, 'linkA')
self._check_resolve_relative(p, P(BASE, 'fileA'))
p = P(BASE, 'dirA', 'linkC', 'fileB')
self._check_resolve_relative(p, P(BASE, 'dirB', 'fileB'))
p = P(BASE, 'dirB', 'linkD', 'fileB')
self._check_resolve_relative(p, P(BASE, 'dirB', 'fileB'))
# Now create absolute symlinks
d = tempfile.mkdtemp(suffix='-dirD')
self.addCleanup(shutil.rmtree, d)
os.symlink(os.path.join(d), join('dirA', 'linkX'))
os.symlink(join('dirB'), os.path.join(d, 'linkY'))
p = P(BASE, 'dirA', 'linkX', 'linkY', 'fileB')
self._check_resolve_absolute(p, P(BASE, 'dirB', 'fileB'))

Why not just combine them to _check_resolve to avoid confusion? It did confuse 
me. I was not sure whether I had to check the absolute link differently than 
the relative link.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19873
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com