[issue15392] Create a unittest framework for IDLE
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 is now part of the Python standard library, available as unittest.mock in Python 3.3 onwards." And yes, GUI testings While I was writting my proposal on this project Todd.Rovito mentioned me " .. you should still complete some GUI tests so future developers will have a model. " -- nosy: +JayKrish ___ Python tracker <http://bugs.python.org/issue15392> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15392] Create a unittest framework for IDLE
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 practice). Test for the presence of idle and skip if idle is not available. Move the existing,pending tests for idle ( http://bugs.python.org/file27613/issue16226_test.patch , http://bugs.python.org/file24075/test_idlelib.py,) into this directory. (which my patch 15392_idletestframework_1.patch did for me) Considering the point terry.reedy mentioned, "Adding test/test_idle will not be too much use until issue #10652 is resolved so it would actually run with -m test", my view is, the issue #10652 on this message is on a healthy patch review, so it would actually run with -m test in near-future Expecting your suggestions on this design decisions. -- keywords: +patch Added file: http://bugs.python.org/file29973/15392_idletestframework_1.patch ___ Python tracker <http://bugs.python.org/issue15392> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18189] IDLE Improvements: Unit test for Delegator.py
New submission from R. Jayakrishnan: Continuing the IDLE unittest framework initiated in http://bugs.python.org/issue15392. A small unit test for IDLE Delegator.py module. This patch introduces a test module named test_delegator.py inside Lib/idlelib/idle_test, considering the points README file in idle_test. The test method test_setdelegate() simply passes a text widget to Delegator by calling setdelegate(), and test the widget returned by getdelegate() for the same. -- components: IDLE files: test_delegator.patch keywords: patch messages: 190960 nosy: JayKrish priority: normal severity: normal status: open title: IDLE Improvements: Unit test for Delegator.py type: enhancement versions: Python 3.4 Added file: http://bugs.python.org/file30544/test_delegator.patch ___ Python tracker <http://bugs.python.org/issue18189> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18189] IDLE Improvements: Unit test for Delegator.py
Changes by R. Jayakrishnan : -- versions: +Python 2.7, Python 3.3 ___ Python tracker <http://bugs.python.org/issue18189> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18103] Create a GUI test framework for Idle
Changes by R. Jayakrishnan : -- nosy: +JayKrish ___ Python tracker <http://bugs.python.org/issue18103> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18104] Idle: make human-mediated GUI tests usable
Changes by R. Jayakrishnan : -- nosy: +JayKrish ___ Python tracker <http://bugs.python.org/issue18104> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18189] IDLE Improvements: Unit test for Delegator.py
R. Jayakrishnan added the comment: The "from test.resource import requires" give me errors saying no module named resource in test (Am I missing anything?) For the moment I use "from test.support import requires" as in test_delegator1.patch . from test.support import requires requires('gui') class Test_delegator(unittest.TestCase): def setUp(self): . The results follows --- jaykrish@jaykrish-Vostro-1520:~/gsoc/cpy/cpython$ ./python -m test -ugui test_idle [1/1] test_idle 1 test OK. [189373 refs] -- jaykrish@jaykrish-Vostro-1520:~/gsoc/cpy/cpython$ ./python -m test test_idle [1/1] test_idle test test_idle failed -- Traceback (most recent call last): File "/home/jaykrish/gsoc/cpy/cpython/Lib/unittest/case.py", line 384, in _executeTestPart function() File "/home/jaykrish/gsoc/cpy/cpython/Lib/unittest/loader.py", line 32, in testFailure raise exception ImportError: Failed to import test module: idlelib.idle_test.test_delegator Traceback (most recent call last): File "/home/jaykrish/gsoc/cpy/cpython/Lib/unittest/loader.py", line 261, in _find_tests module = self._get_module_from_name(name) File "/home/jaykrish/gsoc/cpy/cpython/Lib/unittest/loader.py", line 239, in _get_module_from_name __import__(name) File "/home/jaykrish/gsoc/cpy/cpython/Lib/idlelib/idle_test/test_delegator.py", line 8, in requires('gui') File "/home/jaykrish/gsoc/cpy/cpython/Lib/test/support.py", line 390, in requires raise ResourceDenied(msg) test.support.ResourceDenied: Use of the 'gui' resource not enabled 1 test failed: test_idle [189233 refs] --- And yes, the teardown method using self.root.destroy() now. -- Added file: http://bugs.python.org/file30626/test_delegator1.patch ___ Python tracker <http://bugs.python.org/issue18189> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18189] IDLE Improvements: Unit test for Delegator.py
Changes by R. Jayakrishnan : Removed file: http://bugs.python.org/file30626/test_delegator1.patch ___ Python tracker <http://bugs.python.org/issue18189> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18189] IDLE Improvements: Unit test for Delegator.py
Changes by R. Jayakrishnan : Added file: http://bugs.python.org/file30627/test_delegator1.patch ___ Python tracker <http://bugs.python.org/issue18189> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18189] IDLE Improvements: Unit test for Delegator.py
Changes by R. Jayakrishnan : -- nosy: +ncoghlan ___ Python tracker <http://bugs.python.org/issue18189> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18189] IDLE Improvements: Unit test for Delegator.py
R. Jayakrishnan added the comment: I wrapped requires('gui') as submitted in patch2. But this time commands "python -m test test_idle" and with -ugui does not skip delegatortest (it runs successfully to both). I took Lib/test/test_tk.py as an example. It calls runtktests.get_tests using support.run_unittest from test module. Exploring Lib/tkinter/test/runtktests.py the get_tests method begins like def get_tests(text=True, gui=True, packages=None): """Yield all the tests in the modules found by get_tests_modules. If nogui is True, only tests that do not require a GUI will be returned.""" attrs = [] if text: attrs.append('tests_nogui') if gui: attrs.append('tests_gui') also notice the main method calles "test.support.use_resources = ['gui']" Now the tktests have the line * require('gui') * before the class bigins, for example have a look on test_textensions.py So do we have to come up with the same procedure to skip and play with gui and non-gui tests for IDLE ? correct me if I am wrong anywhere. -- Added file: http://bugs.python.org/file30691/test_delegator2.patch ___ Python tracker <http://bugs.python.org/issue18189> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18292] IDLE Improvements: Unit test for AutoExpand.py
New submission from R. Jayakrishnan: Continuing the IDLE unittest framework initiated in #15392. Writing test for AutoExpand.py -- components: IDLE, Tests messages: 191795 nosy: JayKrish priority: normal severity: normal status: open title: IDLE Improvements: Unit test for AutoExpand.py type: enhancement versions: Python 2.7, Python 3.3, Python 3.4 ___ Python tracker <http://bugs.python.org/issue18292> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18425] IDLE Unit test for IdleHistory.py
New submission from R. Jayakrishnan: Continuing the IDLE unittest framework #15392, unit test for IdleHistory.py. This test depends on mockText and uses the patch by Terry at issue #18365. Because the mockText is still about to commit, first patch http://bugs.python.org/file30865/mock_text2.diff and then use test_idlehistory.patch to run test_idlehistory. Once the mock Text get committed I will improve the patch according to. -- components: IDLE files: test_idlehistory.patch keywords: patch messages: 192840 nosy: JayKrish, terry.reedy priority: normal severity: normal status: open title: IDLE Unit test for IdleHistory.py type: enhancement versions: Python 2.7, Python 3.3, Python 3.4 Added file: http://bugs.python.org/file30885/test_idlehistory.patch ___ Python tracker <http://bugs.python.org/issue18425> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue17535] IDLE: Add an option to show line numbers along the left side of the editor window, and have it enabled by default.
Changes by R. Jayakrishnan : -- nosy: +JayKrish ___ Python tracker <http://bugs.python.org/issue17535> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18365] Idle: mock Text class and test thereof
Changes by R. Jayakrishnan : -- nosy: +JayKrish ___ Python tracker <http://bugs.python.org/issue18365> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18425] IDLE Unit test for IdleHistory.py
R. Jayakrishnan added the comment: Now we have the mockText, So I updated my test for Idlehistory. The submitted patch2 contains tests for two methods in Idlehistory (history_store and History_do). I hope the tests for history_store are done. But the history_do method tests fails. I explored a bit on the failure trace, History_do method is called by PyShell.py before it calls, pyShell does self.text.mark_set("iomark", "insert") and passes the Text to IdleHistory. Now Idlehistory uses 'iomark' as an index. Mock Text's _decode only handles specific input indexes (as it mentions), that means this 'iomark' index failed to all the logic of _decode method and finally crosses line, char = index.split('.') line which eventually raises a ValueError: need more than 1 value to unpack. One option is to create an issue to futher develop mock Text and implement mark_set also the _decode and so on, or Is it sounds like making stuffs more complex?, so we may decide the implemented tests are adequate enough for now. -- Added file: http://bugs.python.org/file30912/test_idlehistory1.patch ___ Python tracker <http://bugs.python.org/issue18425> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18425] IDLE Unit test for IdleHistory.py
R. Jayakrishnan added the comment: Thanks Terry for "we have the option of gui tests when mocking becomes too complicated" I put two separate classes IdleHistoryMockTest and IdleHistoryTKTest for mock and TK text usages and used TK Text to test IdleHistory.history_do function. This worked for me and hopefully IMHO the logic behind history_do is tested enough for now. -- Added file: http://bugs.python.org/file30963/test_idlehistory2.patch ___ Python tracker <http://bugs.python.org/issue18425> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18504] IDLE:Improvements- Improving Mock_Text
New submission from R. Jayakrishnan: Following the Idle: mock Text class and test thereof created #18365 I am trying to improve the _decode function because most of the Idletests needs the mock text and requires some more features to handle indexes. Started improving the mockText _decode method while writing unit test for AutoExpand.py at #18292. For now I want the mock text to decode following indexes: line.char, insert, end, +-#c/chars, lineend, linestart, wordstart, wordend For this I am trying to write regular expressions to extract the parts of index. The submitted decodeTest.py is a sample script to show how my regular expression starts manipulating the decoding of indexes. I have attached a checklist of several indexes. So you can easily run them and get an understanding of my approach. -- files: decodeTest.py messages: 193358 nosy: JayKrish priority: normal severity: normal status: open title: IDLE:Improvements- Improving Mock_Text Added file: http://bugs.python.org/file30978/decodeTest.py ___ Python tracker <http://bugs.python.org/issue18504> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18504] IDLE:Improvements- Improving Mock_Text
Changes by R. Jayakrishnan : Added file: http://bugs.python.org/file30979/decodeChecklist.txt ___ Python tracker <http://bugs.python.org/issue18504> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18504] IDLE:Improvements- Improving Mock_Text
Changes by R. Jayakrishnan : Removed file: http://bugs.python.org/file30978/decodeTest.py ___ Python tracker <http://bugs.python.org/issue18504> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18504] IDLE:Improvements- Improving Mock_Text
Changes by R. Jayakrishnan : Added file: http://bugs.python.org/file30980/decodeTest.py ___ Python tracker <http://bugs.python.org/issue18504> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18292] IDLE Improvements: Unit test for AutoExpand.py
R. Jayakrishnan added the comment: I am trying to improve the _decode function of mock Text class because most of the Idletests needs the mock text and requires some more features to handle indexes. Created an issue IDLE:Improvements- Improving Mock_Text http://bugs.python.org/issue18504 -- ___ Python tracker <http://bugs.python.org/issue18292> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18425] IDLE Unit test for IdleHistory.py
Changes by R. Jayakrishnan : -- resolution: -> works for me ___ Python tracker <http://bugs.python.org/issue18425> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18504] IDLE:Improvements- Improving Mock_Text
Changes by R. Jayakrishnan : -- nosy: +Todd.Rovito ___ Python tracker <http://bugs.python.org/issue18504> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18504] IDLE:Improvements- Improving Mock_Text
R. Jayakrishnan added the comment: Yes,correcting myself. I should aim indexes which actual idlelib uses. Thank you Terry for the grammar. Fighting with the index parsing last week, and finally came up with a level to break the index into base and modifier and decode it along with using regular expressions. Now the mock_tk attached at this patch passes all the existing test cases, and failing the new test I have written on text_test The problem now I am dealing with is, there are four exceeding conditions I have to handle which make errors. 1.returning line < 0 2.returning line > last line 3.returning char < 0 4.returning char > its line length For example, in parsing base the return line may exceed last line but the modifier will say '-2lines' doing that, now the return line is not exceeding last line. -- keywords: +patch Added file: http://bugs.python.org/file31043/mocktk_decodeByRE1.patch ___ Python tracker <http://bugs.python.org/issue18504> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18704] IDLE: PEP8 Style Check Integration
New submission from R. Jayakrishnan: This is to create an IDLE extension that would integrate PEP8 (Syntax Style Checker https://pypi.python.org/pypi/pep8 ) into the IDLE editor window,so the developer who is using the IDLE editor can quickly and frequently check the PEP8 standards of the code which is being developed in an IDLE editor window. Many modern IDE's have not only syntax highlighting but on the fly syntax checking. Python ensures the quality of code with its own standards implemented as PEP8. The tool pep8 checks Python code against some of the style conventions in PEP8. Also the PEP8 standardization should not be a ‘must emphasizing’ for a python developer, therefore configuring pep8 to enable/disable errors and warning in various levels should be implemented. The implementation work is started by Todd at https://bitbucket.org/rovitotv/pythonpatches/src/fae1fdab936043ec35db541808f5789325762fb3/PEP8CheckExtension.patch?at=default The submitted patch is an effort started from Todd's patch as an example. The IDLE with this patch will show PEP8 style check toggle menu in Options. Once PEP8 check enabled the current module is checked by pep8 tool and the defects will be shown in a extended left pane. Defect codes will be listed as a Buttons, button click leads to highlighting the line and column of the defect and scroll editor window if needed. It is expected that the developer will correct the defect with the help of the message and eventually press the Resolve button,which refresh the pane. This is an initial work and I am looking forward for suggestions on improvements and mistakes of this patch. -- components: IDLE files: PEP8Extension_1.patch keywords: patch messages: 194841 nosy: JayKrish priority: normal severity: normal status: open title: IDLE: PEP8 Style Check Integration type: enhancement versions: Python 2.7, Python 3.3, Python 3.4 Added file: http://bugs.python.org/file31221/PEP8Extension_1.patch ___ Python tracker <http://bugs.python.org/issue18704> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18704] IDLE: PEP8 Style Check Integration
Changes by R. Jayakrishnan : -- nosy: +Todd.Rovito ___ Python tracker <http://bugs.python.org/issue18704> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18704] IDLE: PEP8 Style Check Integration
Changes by R. Jayakrishnan : -- nosy: +philwebster ___ Python tracker <http://bugs.python.org/issue18704> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18583] Idle: enhance FormatParagraph
Changes by R. Jayakrishnan : -- nosy: +JayKrish ___ Python tracker <http://bugs.python.org/issue18583> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18704] IDLE: PEP8 Style Check Integration
R. Jayakrishnan added the comment: Thanks for showing great interest on this idea. As usual, it seems this will going to be another nice project with IDLE for me. Better to close this issue then, and create an appropriate initiation with the suggested points(preferring a commencement by core developers). Anyway to keep in touch with the Python analyzing and related tools, I have initiated a separate project with porting the works done on the patch here https://github.com/Jay-Krish/IDLEAnalyzer. I Hope this will help further while working on this project. -- ___ Python tracker <http://bugs.python.org/issue18704> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18704] IDLE: PEP8 Style Check Integration
R. Jayakrishnan added the comment: I would prefer this issue concludes with a navigation to the new proposed enhancement. -- ___ Python tracker <http://bugs.python.org/issue18704> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com