[issue16079] list duplicate test names with patchcheck

2019-11-27 Thread Brett Cannon
Change by Brett Cannon : -- nosy: -brett.cannon ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail

[issue16079] list duplicate test names with patchcheck

2019-09-10 Thread Ned Deily
Ned Deily added the comment: The open proposed PR for this issue has been languishing unreviewed for several months now. Since the proposal is really a request to change our development process, I'm nosying Brett and Łukasz (3.9 RM). In any case, if we would decide to add this to our CI, I

[issue16079] list duplicate test names with patchcheck

2019-04-25 Thread Xavier de Gaye
Change by Xavier de Gaye : -- pull_requests: +12876 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://m

[issue16079] list duplicate test names with patchcheck

2019-04-24 Thread Xavier de Gaye
Xavier de Gaye added the comment: Not sure the unittest module is the right place to implement these checks. The following issues deal with duplicates that are not unittest methods: #19127 #19128 #36711 -- ___ Python tracker

[issue16079] list duplicate test names with patchcheck

2019-04-24 Thread Xavier de Gaye
Change by Xavier de Gaye : -- pull_requests: +12864 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://m

[issue16079] list duplicate test names with patchcheck

2019-04-24 Thread Xavier de Gaye
Xavier de Gaye added the comment: List of issues entered for all the current duplicate method definitions in 2.7: #19113 #36711 #36712 #36713 -- ___ Python tracker ___ __

[issue16079] list duplicate test names with patchcheck

2019-04-22 Thread Raymond Hettinger
Raymond Hettinger added the comment: Should the unittest module grow a feature to scan for duplicate methods? I imagine that duplicate methods are a common problem. Possibly, inheriting from unittest can be accompanied by a metaclass that has __prepare__ with special dictionary that detects

[issue16079] list duplicate test names with patchcheck

2019-04-20 Thread Xavier de Gaye
Xavier de Gaye added the comment: PR 12886 adds a check on duplicate method definitions to the travis() function of patchcheck.py. False positives must be entered to Tools/scripts/duplicates_ignored.txt. The existing duplicates have been entered to this file (with the corresponding bpo issu

[issue16079] list duplicate test names with patchcheck

2019-04-20 Thread Xavier de Gaye
Change by Xavier de Gaye : -- pull_requests: +12812 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://m

[issue16079] list duplicate test names with patchcheck

2019-04-20 Thread Xavier de Gaye
Xavier de Gaye added the comment: List of issues entered for all the current duplicate method definitions: #19113 #19119 #36678 #36679 #36680 #36681 #36682 #36683 -- ___ Python tracker _

[issue16079] list duplicate test names with patchcheck

2019-04-16 Thread Xavier de Gaye
Xavier de Gaye added the comment: Thanks for the link Gregory. I will write a script based on ast and check its output against pylint and against the current script based on tokenize. The travis() function of Tools/scripts/patchcheck.py may be modified to import this script and run it only o

[issue16079] list duplicate test names with patchcheck

2019-04-15 Thread Gregory P. Smith
Gregory P. Smith added the comment: Agreed, making duplicate method definitions a CI failure is the desired end state once our test suite is cleaned up and it doesn't have false positives. FYI - pylint also implements this check quite reliably as function-redefined via its pylint.checkers.ba

[issue16079] list duplicate test names with patchcheck

2019-04-15 Thread Xavier de Gaye
Xavier de Gaye added the comment: False positives must be added to the 'ignored_duplicates' file in order to have duplicate_code_names.py exit with success. Not sure whether this may be considered as an annoyance by commiters, if TRAVIS would fail when duplicate_code_names.py fails. All the

[issue16079] list duplicate test names with patchcheck

2019-04-15 Thread STINNER Victor
STINNER Victor added the comment: This script should be part of Python and run in the pre-commit CI like Travis CI! -- ___ Python tracker ___

[issue16079] list duplicate test names with patchcheck

2019-04-14 Thread miss-islington
miss-islington added the comment: New changeset 9f9e029bd2223ecba46eaefecadf0ac252d891f2 by Miss Islington (bot) in branch '3.7': bpo-16079: fix duplicate test method name in test_gzip. (GH-12827) https://github.com/python/cpython/commit/9f9e029bd2223ecba46eaefecadf0ac252d891f2 -- n

[issue16079] list duplicate test names with patchcheck

2019-04-14 Thread Gregory P. Smith
Change by Gregory P. Smith : -- type: enhancement -> behavior ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue16079] list duplicate test names with patchcheck

2019-04-14 Thread miss-islington
Change by miss-islington : -- pull_requests: +12753 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://m

[issue16079] list duplicate test names with patchcheck

2019-04-14 Thread Gregory P. Smith
Gregory P. Smith added the comment: New changeset cd466559c4a312b3c1223a774ad4df19fc4f0407 by Gregory P. Smith in branch 'master': bpo-16079: fix duplicate test method name in test_gzip. (GH-12827) https://github.com/python/cpython/commit/cd466559c4a312b3c1223a774ad4df19fc4f0407 --

[issue16079] list duplicate test names with patchcheck

2019-04-14 Thread Gregory P. Smith
Change by Gregory P. Smith : -- components: +Tests ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://ma

[issue16079] list duplicate test names with patchcheck

2019-04-14 Thread Gregory P. Smith
Change by Gregory P. Smith : -- keywords: +easy versions: +Python 3.7, Python 3.8 -Python 3.3, Python 3.4 ___ Python tracker ___ ___

[issue16079] list duplicate test names with patchcheck

2019-04-14 Thread Gregory P. Smith
Change by Gregory P. Smith : -- pull_requests: +12752 stage: -> patch review ___ Python tracker ___ ___ Python-bugs-list mailing li

[issue16079] list duplicate test names with patchcheck

2019-04-13 Thread Xavier de Gaye
Xavier de Gaye added the comment: Upgrading the script to account for Python changes. This is now duplicate_code_names_3.py $ ./python ./duplicate_code_names_3.py --ignore ignored_duplicates Lib/test Duplicate method names: Lib/test/test_dataclasses.py:1406 TestCase.test_helper_asdict_builtin

[issue16079] list duplicate test names with patchcheck

2014-10-17 Thread Robert Collins
Robert Collins added the comment: FWIW testtools rejects test suites with duplicate test ids; I'm considering adding that feature into unittest itself. We'd need an option to make it warn rather than error I think, but if we did that we wouldn't need a separate script at all. -- nosy:

[issue16079] list duplicate test names with patchcheck

2013-09-29 Thread STINNER Victor
Changes by STINNER Victor : -- nosy: +haypo ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python

[issue16079] list duplicate test names with patchcheck

2013-09-29 Thread Xavier de Gaye
Xavier de Gaye added the comment: The following issues have been entered for all the above duplicate names found by duplicate_code_names_2.py: issue 19112, issue 19113, issue 19114, issue 19115, issue 19116, issue 19117, issue 19118, issue 19119, issue 19122, issue 19123, issue 19125, issue 1912

[issue16079] list duplicate test names with patchcheck

2013-09-28 Thread Xavier de Gaye
Changes by Xavier de Gaye : Added file: http://bugs.python.org/file31892/ignored_duplicates ___ Python tracker ___ ___ Python-bugs-list mailin

[issue16079] list duplicate test names with patchcheck

2013-09-28 Thread Xavier de Gaye
Xavier de Gaye added the comment: duplicate_code_names_2.py uses tokenize to print duplicate code names within the same scope, excluding property setter/getter/deleter duplicates, excluding duplicates of nested classes or functions, and ignoring duplicates listed in a file (run with --help for mo

[issue16079] list duplicate test names with patchcheck

2013-07-12 Thread Terry J. Reedy
Changes by Terry J. Reedy : -- versions: +Python 3.4 -Python 3.2 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue16079] list duplicate test names with patchcheck

2012-10-01 Thread Xavier de Gaye
Changes by Xavier de Gaye : Added file: http://bugs.python.org/file27376/std_lib_duplicates.txt ___ Python tracker ___ ___ Python-bugs-list ma

[issue16079] list duplicate test names with patchcheck

2012-10-01 Thread Xavier de Gaye
Xavier de Gaye added the comment: The attached script, named duplicate_code_names.py, takes a file name list as argument and prints duplicate code names found in these files ordered by function, class, method and nested class or function. The script output on the whole std lib (see the result in

[issue16079] list duplicate test names with patchcheck

2012-09-29 Thread Chris Jerdonek
Chris Jerdonek added the comment: For informational purposes, here is where unittest defaults to the prefix "test" for finding test methods: http://hg.python.org/cpython/file/f11649b21603/Lib/unittest/loader.py#l48 sqlite3 is able to use "Check" because it manages its own test discovery. For

[issue16079] list duplicate test names with patchcheck

2012-09-29 Thread Xavier de Gaye
Xavier de Gaye added the comment: > Here are a couple examples of test method names that don't begin > with "test_": > > def testLoadTk(self): > def testLoadTkFailure(self): Also Lib/test/test_smtplib.py test method names start with 'test' instead of 'test_' although the 'Regression test

[issue16079] list duplicate test names with patchcheck

2012-09-29 Thread Xavier de Gaye
Xavier de Gaye added the comment: > I'm not sure if there is ever a use case for duplicate method > names. Is there? property getter, setter, and deleter methods do have the same name. -- ___ Python tracker _

[issue16079] list duplicate test names with patchcheck

2012-09-28 Thread Ezio Melotti
Ezio Melotti added the comment: It doesn't necessary have to be limited to methods, anything duplicate might turn out to be a bug. If the script doesn't mix scopes there shouldn't be too many false positives, and if they are it shouldn't be a big deal if they are reported on the changed file

[issue16079] list duplicate test names with patchcheck

2012-09-28 Thread Xavier de Gaye
Xavier de Gaye added the comment: Using the python class browser (pyclbr.py) in conjunction with the search for duplicates in the module code object would allow to restrict the listing of duplicates to functions and methods or even just to methods (depending on the feature requirements), without

[issue16079] list duplicate test names with patchcheck

2012-09-28 Thread Xavier de Gaye
Xavier de Gaye added the comment: Note that using the module code object to find duplicates does not allow for selecting among the different code types: function, nested function, method or class. Duplicates are extensively used within the std lib: Running find_duplicate_test_names.py, the ini

[issue16079] list duplicate test names with patchcheck

2012-09-28 Thread Chris Jerdonek
Chris Jerdonek added the comment: > I thought you were talking about test files. Oh, I see why you said that then. To find the test files themselves, this logic was used in the patch: + fn.startswith(os.path.join('Lib', 'test'))] Regarding your question for the general case,

[issue16079] list duplicate test names with patchcheck

2012-09-28 Thread Ezio Melotti
Ezio Melotti added the comment: > Here are a couple examples of test method names that don't begin with "test_": I thought you were talking about test files. I still don't see why looking for test_* methods, every class might contain duplicate method names, so they should all be checked. ---

[issue16079] list duplicate test names with patchcheck

2012-09-28 Thread Éric Araujo
Éric Araujo added the comment: sqlite3 tests use CheckThing style (urgh). -- ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue16079] list duplicate test names with patchcheck

2012-09-28 Thread Chris Jerdonek
Chris Jerdonek added the comment: Here are a couple examples of test method names that don't begin with "test_": def testLoadTk(self): def testLoadTkFailure(self): http://hg.python.org/cpython/file/f1094697d7dc/Lib/tkinter/test/test_tkinter/test_loadtk.py#l9 -- ___

[issue16079] list duplicate test names with patchcheck

2012-09-28 Thread Ezio Melotti
Ezio Melotti added the comment: > I would like to see this written in a way that would let one > run it globally or on a single file independent of a patch +1 It can be added to Tools/scripts and imported by patchcheck. > I'm pretty sure we have some tests that don't start with 'test_'. IIRC t

[issue16079] list duplicate test names with patchcheck

2012-09-28 Thread Chris Jerdonek
Chris Jerdonek added the comment: I would like to see this written in a way that would let one run it globally or on a single file independent of a patch (e.g. an independent script from which patchcheck could import certain functions). Or is that what you explicitly didn't want Éric? :) Thi

[issue16079] list duplicate test names with patchcheck

2012-09-28 Thread Éric Araujo
Éric Araujo added the comment: Nice feature to do without adding a dependency on a lint tool! -- nosy: +eric.araujo ___ Python tracker ___ ___

[issue16079] list duplicate test names with patchcheck

2012-09-28 Thread Xavier de Gaye
New submission from Xavier de Gaye: See also issue 16056 for the current list of duplicate test names in the std lib. The attached patch improves patchcheck.py to list duplicate test names when running 'make patchcheck'. This patch to the default branch can also be applied asis to the 2.7 branch