[issue9315] The trace module lacks unit tests

2010-09-16 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: List comprehension test is removed from 3.1 in r84848. -- ___ Python tracker ___ ___ Python-bu

[issue9315] The trace module lacks unit tests

2010-09-16 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: See issue #9866 for follow ups on list comprehensions' tracing. -- nosy: -Alexander.Belopolsky status: open -> closed superseder: -> Inconsistencies in tracing list comprehensions ___ Python tracker

[issue9315] The trace module lacks unit tests

2010-09-15 Thread Terry J. Reedy
Terry J. Reedy added the comment: I agree with finishing this and opening a separate issue with respect to list comp behavior. The latter seems peripheral to the purpose of this issue. -- ___ Python tracker __

[issue9315] The trace module lacks unit tests

2010-09-15 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Raymond asked on IRC why this work is being back-ported. The answer is that it is being forward-ported rather than back-ported. The trace module had no unittests in either 2.x or 3.x and was very buggy in 3.x. Presumably, 2.x version saw more use and

[issue9315] The trace module lacks unit tests

2010-09-15 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: I am attaching another test file, y.py, which shows that the cause of discrepancy is outside of the trace module. The traced function is the same as in x.py only with 5 iterations instead of 10 for brevity, but instead of using trace module, I am regist

[issue9315] The trace module lacks unit tests

2010-09-15 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : Added file: http://bugs.python.org/file18891/x.py ___ Python tracker ___ ___ Python-bugs-list mailing list Un

[issue9315] The trace module lacks unit tests

2010-09-15 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: > Is it really *interesting* to trace separate parts of list > comprehensions like this? It may or may not be useful for tracing code in the wild, but it helps to isolate the causes of count mismatches. I am attaching a file, x.py, that shows differing

[issue9315] The trace module lacks unit tests

2010-09-15 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : Removed file: http://bugs.python.org/file1/unnamed ___ Python tracker ___ ___ Python-bugs-list mailing li

[issue9315] The trace module lacks unit tests

2010-09-15 Thread Antoine Pitrou
Changes by Antoine Pitrou : -- Removed message: http://bugs.python.org/msg116438 ___ Python tracker ___ ___ Python-bugs-list mailing li

[issue9315] The trace module lacks unit tests

2010-09-15 Thread Eli Bendersky
Eli Bendersky added the comment: Is it really *interesting* to trace separate parts of list comprehensions like this? What would one want to do that? The only idea I have in mind of perhaps for comprehensions containing 'if's, to know how many times the comprehension was actually executed. In a

[issue9315] The trace module lacks unit tests

2010-09-15 Thread teresap989
teresap989 added the comment: I was about to commit issue9315.3.patch, which is a lightly modified version of issue9315.2.patch, but it turned out that test_trace cannot be run by regrtest.py: $ ./python.exe Lib/test/regrtest.py test_trace test_trace test test_trace failed -- multiple errors

[issue9315] The trace module lacks unit tests

2010-09-15 Thread Antoine Pitrou
Antoine Pitrou added the comment: > It looks like 3.1 with computed gotos produces the yet another different > tracing of list comprehensions: > > > 2: l = [i for >10: i in > 1: range(10)] Well, this kind of thing is going to depend on the exact bytecode, the way the ev

[issue9315] The trace module lacks unit tests

2010-09-14 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: It looks like 3.1 with computed gotos produces the yet another different tracing of list comprehensions: 2: l = [i for 10: i in 1: range(10)] -- ___ Python tracker

[issue9315] The trace module lacks unit tests

2010-09-14 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: > Antoine suggests to relax the test and only check > if the count is within a range (12, 13). This feels like implementation driven testing. I would prefer to disable the offending test pending further investigation into the core cause. It is not cle

[issue9315] The trace module lacks unit tests

2010-09-14 Thread Florent Xicluna
Florent Xicluna added the comment: The issue on 3.1 happens when Python is configured --with-computed-gotos. (this is the case on all 3.1 buildbots) But this issue does not happen on 3.x branch. On this branch computed-gotos is the default, but the switch --without-computed-gotos does not make

[issue9315] The trace module lacks unit tests

2010-09-14 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Updated Makefile in r84803 - r84805. -- ___ Python tracker ___ ___ Python-bugs-list mailing li

[issue9315] The trace module lacks unit tests

2010-09-14 Thread Florent Xicluna
Florent Xicluna added the comment: It looks like lots of 3.1 buildbots are unhappy with r84783. But the test passes on my local 3.1 checkout. == FAIL: test_trace_list_comprehension (test.test_trace.TestLineCounts)

[issue9315] The trace module lacks unit tests

2010-09-14 Thread Georg Brandl
Georg Brandl added the comment: Yep. But there are other files to edit for the Windows distribution. -- ___ Python tracker ___ ___ Py

[issue9315] The trace module lacks unit tests

2010-09-13 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: On Tue, Sep 14, 2010 at 2:29 AM, Georg Brandl wrote: .. > Note that if you add new directories under /Lib, you need to make the build > system aware of them in several > places (I don't remember all of them right now, one is in the Makefile).   > Otherwi

[issue9315] The trace module lacks unit tests

2010-09-13 Thread Georg Brandl
Georg Brandl added the comment: Note that if you add new directories under /Lib, you need to make the build system aware of them in several places (I don't remember all of them right now, one is in the Makefile). Otherwise they don't get shipped and/or installed, and tests fail. --

[issue9315] The trace module lacks unit tests

2010-09-13 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: > You probably missed Lib/test/tracedmodules/ fixed in r84794. -- ___ Python tracker ___ ___

[issue9315] The trace module lacks unit tests

2010-09-13 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: You must be right. I thought I did all the svn adds, but may have missed something. I'll take care of this tonight, but I am off the grid for the next 3-4 hours. On Sep 13, 2010, at 3:13 PM, Florent Xicluna wrote: > > Florent Xicluna added the comm

[issue9315] The trace module lacks unit tests

2010-09-13 Thread Florent Xicluna
Florent Xicluna added the comment: You probably missed Lib/test/tracedmodules/ in r84780 ;) -- keywords: +buildbot nosy: +flox ___ Python tracker ___

[issue9315] The trace module lacks unit tests

2010-09-13 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Committed in: py3k: r84780 release31-maint: r84783 release27-maint: r84777 Need a separate issue for the problem highlighted in msg116336. -- status: open -> closed ___ Python tracker

[issue9315] The trace module lacks unit tests

2010-09-13 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Eli, while porting your tests to py3k, I had to change expected output for list comprehension testing. This is not really surprising because 3.x comprehensions differ from 2.x (they don't leak the loop variable anymore). The difference between versions

[issue9315] The trace module lacks unit tests

2010-09-13 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Committed with minor changes in r84777. Eli, please keep lines under 80 characters. Leaving the issue open pending py3k port. -- resolution: -> accepted stage: patch review -> committed/rejected ___ Python t

[issue9315] The trace module lacks unit tests

2010-09-13 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Hmm, it looks like patches 5 and 6 lost the fix for the class name issue. I'll check if I can merge in patch 4. -- ___ Python tracker ___

[issue9315] The trace module lacks unit tests

2010-08-06 Thread Eli Bendersky
Eli Bendersky added the comment: [attaching a new patch version] 1. Are you refering to Lib/test/tracedmodules/__init__.py? I did add it - it appears in the patchfile. What do you mean? 2. Fixed 3. Fixed 4. I'm not sure. Tracing of the current file is also a common use case, and I really o

[issue9315] The trace module lacks unit tests

2010-08-06 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Comments on issue9315.27-maint.5.patch: 1. I think you forgot to svn add Lib/test/__init__.py. 2. Instead of "import tracedmodules.testmod", please use something like "from test.tracedmodules import testmod". There is no need to use implicit relative i

[issue9315] The trace module lacks unit tests

2010-08-06 Thread Eli Bendersky
Eli Bendersky added the comment: I'm attaching a new patch for unit-testing of trace.py. Changes: 1. Fixed the problems that caused failures when run through regrtest 2. Added the test class from issue 3821 3. Removed the fake module creation, replacing it with a directory named 'tracedmodules

[issue9315] The trace module lacks unit tests

2010-08-05 Thread Eli Bendersky
Eli Bendersky added the comment: The test class added into test_trace.py in issue 3821 fails in verbose mode (see my message http://bugs.python.org/msg113076). I'm merging that class into my larger test_trace.py and will fix this problem, unless you guys have other ideas. -- ___

[issue9315] The trace module lacks unit tests

2010-08-05 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: On Thu, Aug 5, 2010 at 2:04 PM, Eli Bendersky wrote: .. > Georg, > > Are you having plans for writing comprehensive tests for the module, or is > this just a placeholder? I think I can answer for Georg (subject to being corrected, of course.) Georg's c

[issue9315] The trace module lacks unit tests

2010-08-05 Thread Eli Bendersky
Eli Bendersky added the comment: Alexander, Yes, I plan to work on this during the weekend (which starts tomorrow where I'm at). Georg, Are you having plans for writing comprehensive tests for the module, or is this just a placeholder? I have no problem merging with this change, but if you

[issue9315] The trace module lacks unit tests

2010-08-05 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Eli, Are you still working on this? Please note that Georg committed "beginnings of a trace.py unittest" in r83527, so your tests will need to be merged with his. -- nosy: +georg.brandl ___ Python tracker <

[issue9315] The trace module lacks unit tests

2010-08-01 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: On Sun, Aug 1, 2010 at 11:05 PM, Eli Bendersky wrote: .. > The fake module was the least intrusive way I could think of to simulate > stuff for trace.py - > it's a scalable approach if I'll need more than one module in the future for > some stress- > te

[issue9315] The trace module lacks unit tests

2010-08-01 Thread Eli Bendersky
Eli Bendersky added the comment: I understand you, Alexander, but this problem (as is the previous) **doesn't have anything to do with the fake module**. It would happen even if I didn't have it. Why does it only strike this test, then? Because of my usage of __file__ to compare expected res

[issue9315] The trace module lacks unit tests

2010-08-01 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: While it may be instructive to get to the bottom of what causes this behavior, I believe the right thing to do is to simply place traced code in a separate file in the test directory. Faking a module by manipulating sys.modules is hard to make robust. --

[issue9315] The trace module lacks unit tests

2010-08-01 Thread Eli Bendersky
Eli Bendersky added the comment: The single test-runner in regrtest.py (runtest_inner) uses the standard import machinery (__import__) to load tests. Thus, is the test has been loaded recently (**) it is reloaded from its .pyc file. In such a case, its module __file__ var points to the .pyc f

[issue9315] The trace module lacks unit tests

2010-08-01 Thread Eli Bendersky
Eli Bendersky added the comment: I see a curious behavior with the test runs. To reproduce: 1. Clean up .pyc files in test/ dir 2. Run: py27 regrtest.py -v test_trace---> SUCCESS 3. Run again: py27 regrtest.py -v test_trace---> FAIL Initial investigation points to my usage of __file__

[issue9315] The trace module lacks unit tests

2010-07-31 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : Added file: http://bugs.python.org/file18304/issue9315.4-p3k.patch ___ Python tracker ___ ___ Python-bugs-lis

[issue9315] The trace module lacks unit tests

2010-07-31 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: I am attaching updated patches for py3k and release27-maint branches. Unfortunately I cannot commit them as is. When I run make test, I still get some strange failures. Eli, Why do you need to generated fakemodule inside test_trace? Why not take the

[issue9315] The trace module lacks unit tests

2010-07-31 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mail

[issue9315] The trace module lacks unit tests

2010-07-31 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : Removed file: http://bugs.python.org/file18279/issue9315.3.patch ___ Python tracker ___ ___ Python-bugs-list

[issue9315] The trace module lacks unit tests

2010-07-31 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : Added file: http://bugs.python.org/file18293/issue9315.3.patch ___ Python tracker ___ ___ Python-bugs-list ma

[issue9315] The trace module lacks unit tests

2010-07-31 Thread Ezio Melotti
Ezio Melotti added the comment: FWIW in test_trace.py there's a "ZZZ" that should probably be an "XXX" (and maybe it should be fixed too). -- nosy: +ezio.melotti stage: needs patch -> patch review ___ Python tracker

[issue9315] The trace module lacks unit tests

2010-07-30 Thread Eli Bendersky
Eli Bendersky added the comment: Alexander, Your issue9315.3.patch file doesn't contain the new test module at all. I'm attaching the updated test_trace.py, fixing the problem with running via regrtest. The problem was very simple and not about the fake module - I fixed to runctx with globa

[issue9315] The trace module lacks unit tests

2010-07-30 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : Added file: http://bugs.python.org/file18279/issue9315.3.patch ___ Python tracker ___ ___ Python-bugs-list ma

[issue9315] The trace module lacks unit tests

2010-07-30 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Eli, I was about to commit issue9315.3.patch, which is a lightly modified version of issue9315.2.patch, but it turned out that test_trace cannot be run by regrtest.py: $ ./python.exe Lib/test/regrtest.py test_trace test_trace test test_trace failed --

[issue9315] The trace module lacks unit tests

2010-07-30 Thread Eli Bendersky
Eli Bendersky added the comment: [I wish I could edit/delete my older messages] I've attached a new file, named issue9315.2.patch, with the updated patch. I usually add a numeric prefix before the .patch ending to distinguish consecutive versions of the same patch, and in this case I just sub

[issue9315] The trace module lacks unit tests

2010-07-30 Thread Eli Bendersky
Changes by Eli Bendersky : Removed file: http://bugs.python.org/file18269/issue9315.1.patch ___ Python tracker ___ ___ Python-bugs-list mailing

[issue9315] The trace module lacks unit tests

2010-07-30 Thread Eli Bendersky
Eli Bendersky added the comment: Ouch, sorry Here it is (issue9315.1.patch) -- Added file: http://bugs.python.org/file18275/issue9315.2.patch ___ Python tracker ___ _

[issue9315] The trace module lacks unit tests

2010-07-30 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Eli, Did you attach a wrong file? New issue9315.1.patch looks the same as old issue9315.1.patch. -- ___ Python tracker ___

[issue9315] The trace module lacks unit tests

2010-07-30 Thread Eli Bendersky
Eli Bendersky added the comment: Attaching new patch. This patch is for 2.7 (as you suggested earlier, since it's easy to forward-port to py3k with 2to3) and affects Misc/NEWS, Lib/trace.py and Lib/test/test_trace.py (which is added). In Lib/trace.py: - Fixed the problem with class names (tak

[issue9315] The trace module lacks unit tests

2010-07-30 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Eli, Thanks a lot for your continuing effort. I would like to check in your work before any further enhancement. Please find a reasonable stop point and post a commit ready patch preferably with a news file entry describing the bug that is fixed.

[issue9315] The trace module lacks unit tests

2010-07-30 Thread Eli Bendersky
Eli Bendersky added the comment: Some more unit tests show that a problem with method names exists in Lib/trace.py even in 2.7 (and probably earlier). When tracing an instance method with `runfunc`, its name is reported as follows: ClassName'>.method_name Instead of: ClassName.metho

[issue9315] The trace module lacks unit tests

2010-07-28 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: > test test_sys_setprofile crashed ... Fixed in r83204 - r83206. -- ___ Python tracker ___ __

[issue9315] The trace module lacks unit tests

2010-07-28 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Yep, this looks like me. Will fix shortly. Feel free to revert my change if it stops you. On Jul 28, 2010, at 9:39 AM, Antoine Pitrou wrote: > > Antoine Pitrou added the comment: > > test test_sys_setprofile crashed -- : > cannot import name supp

[issue9315] The trace module lacks unit tests

2010-07-28 Thread Antoine Pitrou
Antoine Pitrou added the comment: test test_sys_setprofile crashed -- : cannot import name support Traceback (most recent call last): File "./Lib/test/regrtest.py", line 863, in runtest_inner File "/home/buildbot/slave/py-build/2.7.norwitz-amd64/build/Lib/test/test_sys_setprofile.py", lin

[issue9315] The trace module lacks unit tests

2010-07-28 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: I am on a train. Can take a look in about an hour, but I did not commit anything related to this issue recently. On Jul 28, 2010, at 9:30 AM, Antoine Pitrou wrote: > > Antoine Pitrou added the comment: > > Alexander, it looks like you broke all the

[issue9315] The trace module lacks unit tests

2010-07-28 Thread Antoine Pitrou
Antoine Pitrou added the comment: Alexander, it looks like you broke all the 2.7 buildbots. Could you take a look, please? -- nosy: +pitrou ___ Python tracker ___ __

[issue9315] The trace module lacks unit tests

2010-07-27 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: I am attaching a patch, issue9315-trace-fix.diff, that fixes a py3k bug exposed by issue9315.1-py3k.patch tests. One of the 3.x changes that caused the failure was that frames now have a __doc__ attribute and cannot be distinguished from functions. I r

[issue9315] The trace module lacks unit tests

2010-07-26 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: On Mon, Jul 26, 2010 at 12:49 AM, Eli Bendersky wrote: .. > This raises a question: should method names of classes come after the class > names when appearing > in a trace? Intuitively yes, but I want to investigate some more, probably by > adding a cou

[issue9315] The trace module lacks unit tests

2010-07-25 Thread Eli Bendersky
Eli Bendersky added the comment: The test failure of the py3k ports boils down to this: the 'runfunc' method of 'Trace' appears as a caller to '_traced_func_importing_caller'. In 2.7 it appears as 'Trace.runfunc', in py3k as just 'runfunc'. This raises a question: should method names of class

[issue9315] The trace module lacks unit tests

2010-07-25 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: I will defer to your judgement on the level of "whiteness" that is appropriate. I have passed your patch through 2to3, replaced test_support with support and it looks like we have a test case for a regression in 3.x:

[issue9315] The trace module lacks unit tests

2010-07-25 Thread Eli Bendersky
Changes by Eli Bendersky : -- keywords: +patch Added file: http://bugs.python.org/file18206/issue9315.1.patch ___ Python tracker ___ __

[issue9315] The trace module lacks unit tests

2010-07-25 Thread Eli Bendersky
Changes by Eli Bendersky : Removed file: http://bugs.python.org/file18205/test_trace.py ___ Python tracker ___ ___ Python-bugs-list mailing lis

[issue9315] The trace module lacks unit tests

2010-07-25 Thread Eli Bendersky
Eli Bendersky added the comment: Alexander, 1. Done 2. Done 3. Done. Made docstrings follow PEP 257, to the best of my understanding 4. Done. Attached patch is made on fresh SVN 2.7 branch, file renamed to test_trace.py and 'svn add' executed 5. I'm not sure I agree with you on this point. IM

[issue9315] The trace module lacks unit tests

2010-07-25 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Eli, test_trace_module.py is a good start and I would like to commit it soon. I have a few nitpicks and a suggestion. 1. pprint module is not used in the tests so it should not be imported. 2. It is better to do run_unittest(__name__) in test_main() th

[issue9315] The trace module lacks unit tests

2010-07-25 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Lib/test/test_trace.py is now moved to Lib/test/test_sys_settrace.py. 3.2: r83140 r83141 3.1: r83143 2.7: r83142 -- ___ Python tracker __

[issue9315] The trace module lacks unit tests

2010-07-24 Thread Eli Bendersky
Eli Bendersky added the comment: I'm attaching a file with some unit tests for Lib/trace.py module in Python 2.7. Currently the unit tests check the API only, for line counting, func call counting and function caller relationships, because these can be tested through the API, without capturin

[issue9315] The trace module lacks unit tests

2010-07-21 Thread Terry J. Reedy
Terry J. Reedy added the comment: [from pydev discussion] I agree with renaming current test_trace to test_sys_settrace. If sys.settrace does more than line tracing, and the additional actions are not currently tested in the general sys test, then they should be, eventually, by someone, in a

[issue9315] The trace module lacks unit tests

2010-07-21 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: I am adding 2.7. It is ok to add tests to the stable series release AFAIK. Moreover, I believe the unittests should be written for 2.7 first. Since 3.x port of trace was done without the benefit of a test suite, it is likely that there are many diffe

[issue9315] The trace module lacks unit tests

2010-07-20 Thread Eli Bendersky
New submission from Eli Bendersky : Brought up in issue 9282: unit tests should be added for the trace module. Minor naming problem: Lib/test/test_trace.py is currently employed for testing the sys.settrace method. Suggestion: name the unit tests of the trace module test_trace_module.py -