[issue15392] Create a unittest framework for IDLE

2013-11-03 Thread Roundup Robot
Roundup Robot added the comment: New changeset dac6aea39814 by Ned Deily in branch '2.7': Issue #15392: Install idlelib/idle_test. http://hg.python.org/cpython/rev/dac6aea39814 New changeset e52dad892521 by Ned Deily in branch '3.3': Issue #15392: Install idlelib/idle_test. http://hg.python.org/

[issue15392] Create a unittest framework for IDLE

2013-05-30 Thread Roundup Robot
Roundup Robot added the comment: New changeset 16fea8b0f8c4 by Terry Jan Reedy in branch '3.3': Issue #15392: Finish news entry. http://hg.python.org/cpython/rev/16fea8b0f8c4 -- ___ Python tracker _

[issue15392] Create a unittest framework for IDLE

2013-05-30 Thread Roundup Robot
Roundup Robot added the comment: New changeset 6159916c712e by Terry Jan Reedy in branch '2.7': Issue #15392: Use test.test_support, as used test.support in 3.x. http://hg.python.org/cpython/rev/6159916c712e -- ___ Python tracker

[issue15392] Create a unittest framework for IDLE

2013-05-30 Thread Ezio Melotti
Ezio Melotti added the comment: For the other modules we just use test.test_support on 2.x and test.support in 3.x, without using try/except and without trying to maintain source compatibility with both. You might get a merge conflict every once in a while, but I don't think that's a big deal

[issue15392] Create a unittest framework for IDLE

2013-05-30 Thread Ned Deily
Ned Deily added the comment: The test.support module was renamed in Python 3 from test.test_support in Python 2. While the 3x support has expanded and diverged somewhat, with a bit of try hacking it should be possible to minimize the source differences between the 2.7 and 3.x tests.

[issue15392] Create a unittest framework for IDLE

2013-05-30 Thread Terry J. Reedy
Terry J. Reedy added the comment: Biggest change is no support module in 2.7, so in test_idle.py import inside try:except to skip if dependencies not present. Minor changes in CallTips.py and test_calltips.py. Buildbots are fine. This meets my initial goal; issue done. I opened #18103 for con

[issue15392] Create a unittest framework for IDLE

2013-05-30 Thread Terry J. Reedy
Changes by Terry J. Reedy : -- stage: commit review -> committed/rejected ___ Python tracker ___ ___ Python-bugs-list mailing list Uns

[issue15392] Create a unittest framework for IDLE

2013-05-30 Thread Terry J. Reedy
Changes by Terry J. Reedy : -- status: open -> closed ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://ma

[issue15392] Create a unittest framework for IDLE

2013-05-30 Thread Roundup Robot
Roundup Robot added the comment: New changeset 93eb15779050 by Terry Jan Reedy in branch '2.7': Issue #15392: Create a unittest framework for IDLE, 2.7 version. http://hg.python.org/cpython/rev/93eb15779050 -- ___ Python tracker

[issue15392] Create a unittest framework for IDLE

2013-05-28 Thread Roundup Robot
Roundup Robot added the comment: New changeset 968f6094788b by Terry Jan Reedy in branch '3.3': Issue #15392: Do not run tests if threading/_thread not available. Otherwise http://hg.python.org/cpython/rev/968f6094788b -- ___ Python tracker

[issue15392] Create a unittest framework for IDLE

2013-05-28 Thread Nick Coghlan
Nick Coghlan added the comment: Building without threads is generally going to be for embedded systems without a GUI anyway, so I think it's fine to just skip the entire IDLE test suite when real threads aren't available. -- ___ Python tracker

[issue15392] Create a unittest framework for IDLE

2013-05-27 Thread Terry J. Reedy
Terry J. Reedy added the comment: Last I checked, test_idle passes on the stable buildbots. But it fails on a machine without threads, such as http://buildbot.python.org/all/builders /AMD64%20Fedora%20without%20threads%203.3/builds/752/steps/test/logs/stdio On this machine, thread-related test

[issue15392] Create a unittest framework for IDLE

2013-05-27 Thread Terry J. Reedy
Terry J. Reedy added the comment: Before committing, I experimented with disabling test/test_idle. The simple and safe method is to comment out the 'load_tests' line. With no tests discovered, all pass ;-). Without verbosity, there is no indication that there were none. A little harder, and ne

[issue15392] Create a unittest framework for IDLE

2013-05-27 Thread Roundup Robot
Roundup Robot added the comment: New changeset 24c3e7e08168 by Terry Jan Reedy in branch '3.3': Issue #15392: Create a unittest framework for IDLE. http://hg.python.org/cpython/rev/24c3e7e08168 -- nosy: +python-dev ___ Python tracker

[issue15392] Create a unittest framework for IDLE

2013-05-27 Thread R. David Murray
R. David Murray added the comment: Heh. Yeah, I use patch because I don't just work with mercurial/python, and I find the patch command simpler to use for applying patches in general, since I never want an autocommit. (The exception would be if I'm applying a patch that involves extended di

[issue15392] Create a unittest framework for IDLE

2013-05-26 Thread Todd Rovito
Todd Rovito added the comment: Patch does indeed apply and I get good results! The patch is well done and provides a nice example on how to write unit tests. +1 for making the commit from me R. David Murray you used the patch command while I used "hg import --no-commit mywork.patch" as sp

[issue15392] Create a unittest framework for IDLE

2013-05-21 Thread Terry J. Reedy
Terry J. Reedy added the comment: Attached file tests framework by running idle_tests 6 different ways. Run with the executable that you want to run the tests with as is uses sys.executable. I plan to move it into idle_tests. -- Added file: http://bugs.python.org/file30335/frametest.py

[issue15392] Create a unittest framework for IDLE

2013-05-21 Thread Terry J. Reedy
Terry J. Reedy added the comment: It works when one uses the right dotted name ;-) D:\Python\dev\py33\PCbuild>python_d -m unittest -v idlelib.idle_test.test_calltips.Test_get_entity.test_bad_entity test_bad_entity (idlelib.idle_test.test_calltips.Test_get_entity) ... ok

[issue15392] Create a unittest framework for IDLE

2013-05-21 Thread R. David Murray
R. David Murray added the comment: regrtest now works for me, as does running test_idle.py directly and the simple minded unittest call: ./python -m unittest test.test_idle However, running an individual test doesn't. I don't see this as a show-stopper for committing this, but rather somet

[issue15392] Create a unittest framework for IDLE

2013-05-21 Thread Guilherme Simões
Guilherme Simões added the comment: Now I can apply the patch successfully and everything seems to be working. Thanks, Terry. -- ___ Python tracker ___ _

[issue15392] Create a unittest framework for IDLE

2013-05-20 Thread Terry J. Reedy
Terry J. Reedy added the comment: The change to the two idlelib/*.py files enables those files to run their corresponding idle_test/test_*.py file when run as a main script. They have nothing to do with running test/test_idle.py. So please try running the latter. python -m test.test_idle # dir

[issue15392] Create a unittest framework for IDLE

2013-05-20 Thread Guilherme Simões
Guilherme Simões added the comment: I'm having the same problem as Todd when I apply the patch in my Mac... I have no idea why though. -- ___ Python tracker ___

[issue15392] Create a unittest framework for IDLE

2013-05-20 Thread Terry J. Reedy
Terry J. Reedy added the comment: I will delete 'sim' as an abbreviation for 'support import module'. Does this otherwise seem ready to apply? This time I am really sure it works here, because I ran the 2 tests twice each and cut and pasted the evidence. -- stage: patch review -> commit

[issue15392] Create a unittest framework for IDLE

2013-05-20 Thread Terry J. Reedy
Terry J. Reedy added the comment: Problem solved at least for me with a new patch: D:\Python\dev\py33\PCbuild> python_d -m test test_idle [1/1] test_idle Warning -- os.environ was modified by test_idle 1 test altered the execution environment: test_idle ...> python_d -m test ... [154/373/2

[issue15392] Create a unittest framework for IDLE

2013-05-20 Thread Terry J. Reedy
Changes by Terry J. Reedy : Removed file: http://bugs.python.org/file30264/idletests.diff ___ Python tracker ___ ___ Python-bugs-list mailing

[issue15392] Create a unittest framework for IDLE

2013-05-19 Thread Terry J. Reedy
Terry J. Reedy added the comment: I was really sure that 'python_d -m test' worked a week ago, in the sense that test_idle was run without incident in its proper alphabetical sequence, before I said so and uploaded the patch. Now, there are (different) error messages with both 'python_d -m te

[issue15392] Create a unittest framework for IDLE

2013-05-19 Thread Guilherme Simões
Changes by Guilherme Simões : -- nosy: +Guilherme.Simões ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http:/

[issue15392] Create a unittest framework for IDLE

2013-05-18 Thread R. David Murray
R. David Murray added the comment: I just did an hg pull/hg up in my 3.4 (default) checkout on linux: rdmurray@hey:~/python/p34>patch -p1 ___ ___ Python-bugs-list mailing list Uns

[issue15392] Create a unittest framework for IDLE

2013-05-18 Thread Todd Rovito
Todd Rovito added the comment: I still have the same problem with the patch it will not apply for me on Python 3.4. Based on Ezio's suggestion I used hg verify where I got three warnings unrelated to IDLE, but just to make sure I did a brand new checkout. Even after a new checkout the patch

[issue15392] Create a unittest framework for IDLE

2013-05-17 Thread Alejandro Rodas
Changes by Alejandro Rodas : -- nosy: +alex.rodas ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.p

[issue15392] Create a unittest framework for IDLE

2013-05-15 Thread Terry J. Reedy
Terry J. Reedy added the comment: New patch: I renamed Itest to idle_test everywhere and re-ran tests; removed try-except from test_pathbrowser.py; and renamed @template to @README and rewrote. It applies cleanly to 3.4 on my system. The only problem applying to 2.7 is CallTips.py, which has d

[issue15392] Create a unittest framework for IDLE

2013-05-15 Thread Nick Coghlan
Nick Coghlan added the comment: Terry, the unittest and regrtest command lines are *built* for TDD - you rely on test discovery and selection to run the appropriate tests for what you're working on. However, the point about F5 in IDLE is well made, and a reasonable rationale for ensuring at leas

[issue15392] Create a unittest framework for IDLE

2013-05-15 Thread Terry J. Reedy
Terry J. Reedy added the comment: Tests have at least two very different purposes. One is test-driven development of code (and tests) by developers. The other is regression detection by buildbots. "if __name__" in code modules, in addition to test modules, makes the first much easier. First, t

[issue15392] Create a unittest framework for IDLE

2013-05-15 Thread Ezio Melotti
Ezio Melotti added the comment: Having idle_test under idlelib is fine with me if it makes your life easier. > 3. Many modules have more or useless 'sanity-check' tests run > with the 'if __name__' mechanism. I think *all* of these should > be replaced with unittest.main(xxx, verbosity=2, exit=F

[issue15392] Create a unittest framework for IDLE

2013-05-15 Thread Terry J. Reedy
Terry J. Reedy added the comment: Thanks Nick. Tomorrow I should change the directory name, delete try-except, commit, and move onward on the path laid out. -- ___ Python tracker __

[issue15392] Create a unittest framework for IDLE

2013-05-15 Thread Terry J. Reedy
Terry J. Reedy added the comment: For future reference, there is an idle specific issue that I do not think has been mentioned yet. Idle can run in one process, but the default mode now, and perhaps only mode sometime in the future, is two processes communicating through a socket. Testing two

[issue15392] Create a unittest framework for IDLE

2013-05-15 Thread Terry J. Reedy
Terry J. Reedy added the comment: Ezio, thank you for the response. 1. I care more about where the directory of tests is than what it is called. 'idle_test' or 'idletest' or whatever would be fine. Lets make that the last bikeshed item ;-). 2. I looked as #10572. It was originally about movin

[issue15392] Create a unittest framework for IDLE

2013-05-15 Thread Nick Coghlan
Nick Coghlan added the comment: Just a quick note on the directory naming: idlelib/idle_test sounds like a good option to me. Putting it under idlelib makes it easy for distros to carve it out along with the rest of Idle, as well as making it clear that it falls under the purview of PEP 434

[issue15392] Create a unittest framework for IDLE

2013-05-14 Thread Ezio Melotti
Ezio Melotti added the comment: > I wonder is there is something wrong with the repository. The repo looks ok to me. You could try to run "hg verify" on your machine id you want to make sure your clone is ok. > I wrote about the problem on the committer's list a few days ago, > but got no res

[issue15392] Create a unittest framework for IDLE

2013-05-14 Thread Terry J. Reedy
Terry J. Reedy added the comment: Todd, the last two commits, both rather trivial, I merged from 3.3 to 3.4 would not apply for no reason I could see. I wonder is there is something wrong with the repository. I wrote about the problem on the committer's list a few days ago, but got no response

[issue15392] Create a unittest framework for IDLE

2013-05-14 Thread Ezio Melotti
Ezio Melotti added the comment: Have you tried applying it to 3.3? -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubsc

[issue15392] Create a unittest framework for IDLE

2013-05-14 Thread Todd Rovito
Todd Rovito added the comment: Terry, On my Mac with "hg revert -a" and "hg pull -u" the patch fails to apply on CallTips.py and PathBrowser.py under the latest version of Python 3.4. Here is the output when I try to apply the patch: rovitotv-pc:py34 rovitotv$ hg import --no-commit /Volum

[issue15392] Create a unittest framework for IDLE

2013-05-14 Thread Ezio Melotti
Ezio Melotti added the comment: A few comments about the patch: 1) I would prefer a more explicit idle_test instead of Itest (assuming "I" means idle); 2) having idle_test in Lib/test would be better if possible (see #10572); 3) the tests should only be in idle_test, and not in the "if __name__

[issue15392] Create a unittest framework for IDLE

2013-05-14 Thread Terry J. Reedy
Terry J. Reedy added the comment: Yes, of course. Thanks for correcting. 434, 434, 434,... -- ___ Python tracker ___ ___ Python-bugs-

[issue15392] Create a unittest framework for IDLE

2013-05-14 Thread Todd Rovito
Todd Rovito added the comment: Terry I think you have a typo you mean PEP434 (http://www.python.org/dev/peps/pep-0434/) where PEP343 exists. Can you please confirm? -- ___ Python tracker

[issue15392] Create a unittest framework for IDLE

2013-05-14 Thread Terry J. Reedy
Terry J. Reedy added the comment: Attached is a 3.3 patch that I *believe* is ready to commit and push. With my Win7 repository build, I tested running one test from a file (after "if __name__ == '__main__':") or command line ('python_d -m idlelib.PathBrowser'); all idle tests with an interacti

[issue15392] Create a unittest framework for IDLE

2013-05-07 Thread Nick Coghlan
Nick Coghlan added the comment: I've added 2.7 to the affected versions - the core unittest framework should be present in all 3 versions, so the choice of if/when to backport a fix and its test can be made on a case-by-case basis, rather than being a foregone conclusion due to the lack of IDL

[issue15392] Create a unittest framework for IDLE

2013-05-05 Thread Todd Rovito
Todd Rovito added the comment: This issue appears like it is making progress. For a very small contribution I tested JayKrish's patch and it seems to work on my Mac. The results are documented below. Any comment from Python Core Developers on what needs to happen to get it committed? It appe

[issue15392] Create a unittest framework for IDLE

2013-04-24 Thread Tomoki Imai
Tomoki Imai added the comment: I have already posted idle_dev mailing list (and, no one replied :P). I think, Ezio's suggestion is good if we will work for Python2. Using unittest.mock and mock to support Python2 and Python3. My proposal for GSoC is here. Making very initial version for Python2

[issue15392] Create a unittest framework for IDLE

2013-04-23 Thread Nick Coghlan
Nick Coghlan added the comment: +1 for Ezio's suggestion regarding tests that need the mock module. To simplify backporting you may want to do something like the following in a helper module: try: import unittest.mock as mock except ImportError: try: import m

[issue15392] Create a unittest framework for IDLE

2013-04-23 Thread Ezio Melotti
Ezio Melotti added the comment: If things are fixed/added/improved on 3.x, there should be tests for them, and if they are backported on 2.7, tests should be backported as well. If mock makes testing easier, I think it would be acceptable to use it and then have IDLE devs install a 2.7 mock and

[issue15392] Create a unittest framework for IDLE

2013-04-22 Thread Terry J. Reedy
Terry J. Reedy added the comment: When I opened this last July, I intentionally left off 2.7 for multiple reasons. 1. I knew that the new-in-3.3 mock module would probably be needed for some types of testing. (As for 3.2: at that time, I expected 3.2.4 to be released in September or October, j

[issue15392] Create a unittest framework for IDLE

2013-04-22 Thread R. David Murray
R. David Murray added the comment: I think the issue of whether/how to test Python2 idle should be discussed on idle-dev. One strategy is to make the tests backward compatible (so no mock). Another possible strategy is to have an extra bit of test framework for IDLE in 2.7 that copies the te

[issue15392] Create a unittest framework for IDLE

2013-04-22 Thread Tomoki Imai
Tomoki Imai added the comment: Oh, no support for Python2? I think, it is too old, but still needs bug-fix supports. IDLE for Python2 is really buggy. For example, unicode problems in my environment. http://bugs.python.org/issue17348 It might be GUI related problem. By the way, your proposal se

[issue15392] Create a unittest framework for IDLE

2013-04-21 Thread Jayakrishnan
Jayakrishnan added the comment: There is a need of a proper design in whether to put tests in test sub directory or to create idlelib/test directory. For my GSoc proposal initial draft, I suggested to start with Put tests in test/test_idle directory (like test/test_email would be the best pr

[issue15392] Create a unittest framework for IDLE

2013-04-21 Thread Jayakrishnan
Jayakrishnan added the comment: The aimed versions for this unit test frame work is python 3.3, 3.4. So as Nick said, unittest.mock may have no issues on this. As you said 3rd party modules seems not a better way.But the link you provided ( https://pypi.python.org/pypi/mock ) says .. "mock

[issue15392] Create a unittest framework for IDLE

2013-04-19 Thread Tomoki Imai
Tomoki Imai added the comment: I'm a student thinking of participating in Google Summer of Code. And want to work to create a unittest for IDLE. Using unittest.mock seemed to be good way to test GUI. But there is a problem. There is no unittest.mock in Python2. http://docs.python.org/2/library/u

[issue15392] Create a unittest framework for IDLE

2013-03-22 Thread Nick Coghlan
Nick Coghlan added the comment: I'll start with a bit of philosophical guidance :) 1. As much as possible, push logic testing down into the non-GUI tests. Where unittest.mock can help here is when you have a piece of code to test that is *almost* independent of the GUI, but needs to call an AP

[issue15392] Create a unittest framework for IDLE

2013-03-22 Thread Francisco Martín Brugué
Changes by Francisco Martín Brugué : -- nosy: +francismb ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http:/

[issue15392] Create a unittest framework for IDLE

2013-03-22 Thread Tshepang Lekhonkhobe
Changes by Tshepang Lekhonkhobe : -- nosy: +tshepang ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mai

[issue15392] Create a unittest framework for IDLE

2013-03-21 Thread Terry J. Reedy
Terry J. Reedy added the comment: Since writing this, I ran test_ttk_guionly by itself, so it would run, and saw the flickering windows. I have thought about using unitest.mock and Nick has offered to help particlarly with that. -- nosy: +ncoghlan versions: +Python 3.4 -Python 3.2 ___

[issue15392] Create a unittest framework for IDLE

2012-10-25 Thread Roger Serwy
Roger Serwy added the comment: Issue7883 also has a test. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: ht

[issue15392] Create a unittest framework for IDLE

2012-10-20 Thread Todd Rovito
Changes by Todd Rovito : -- nosy: +Todd.Rovito ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.pyth

[issue15392] Create a unittest framework for IDLE

2012-10-18 Thread Ned Deily
Ned Deily added the comment: There is now one test available to be applied from Issue16226; see http://bugs.python.org/file27613/issue16226_test.patch. It may need to be modified depending on where the tests are ultimately put in the source tree. -- nosy: +ned.deily _

[issue15392] Create a unittest framework for IDLE

2012-07-22 Thread Ezio Melotti
Changes by Ezio Melotti : -- nosy: +ezio.melotti ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.py

[issue15392] Create a unittest framework for IDLE

2012-07-21 Thread R. David Murray
R. David Murray added the comment: The screen flickers a bunch, so something involving my display is certainly happening. As for runtktests...test suites that live in the package as opposed to the test directory require support files to gather the tests to be run. This can be done by the te

[issue15392] Create a unittest framework for IDLE

2012-07-19 Thread Terry J. Reedy
Terry J. Reedy added the comment: I have not really used unittest, so I only know to blindly copy what has been done. Hence I need help to do better. Do you actually get gui tests for test_tk? When I run test/test_tk from Idle editor, and hence as __main__, I only get non-gui tests in spite o

[issue15392] Create a unittest framework for IDLE

2012-07-19 Thread R. David Murray
R. David Murray added the comment: All the tests should run from the standard test runner tool (currently regrtest), with the GUI tests guarded by the GUI resource, which is how it works for TK. I always run the test suite with -uall before non-trivial commits, so I do in fact run the TK gui

[issue15392] Create a unittest framework for IDLE

2012-07-18 Thread Terry J. Reedy
New submission from Terry J. Reedy : Idle needs a unittest framework for module test modules. This means a test directory with at least one test module, a runtest module that successfully runs that test module, any new support functions needed for that test module, and inclusion of test_idle i