Python files with a name starting with '.' are not analysed but pythoscope still tries to build tests for it.

Bug #487138 reported by Pieter Van Dyck
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Pythoscope
Fix Released
Medium
Michal Kwiatkowski

Bug Description

environment: windows, python 2.5.4, pythoscope 1.4.2

test case in attachment

log:
E:\projects\scope_tests\test2.4>pythoscope --init

E:\projects\scope_tests\test2.4>pythoscope *.py
INFO: No changes discovered in the source code, skipping dynamic inspection.
ERROR: Couldn't find information on module '.my_cool_class.py'. This shouldn't happen, please file a bug report at https://bugs.launchpad.net/pythoscope.

Revision history for this message
Pieter Van Dyck (vandyck-pieter) wrote :
Revision history for this message
Michal Kwiatkowski (ruby) wrote :

Pythoscope failed because of an exception, that is a bug and I'll fix that.

Another issue is whether Pythoscope should inspect modules that it ignored earlier but were explicitly specified on the command line. I would say yes, it should do that. In your particular case pythoscope should notice that ".my_cool_class.py" wasn't inspected earlier, so it should inspect it and then generate tests for it. Do you think that's a good solution?

Changed in pythoscope:
importance: Undecided → Medium
milestone: none → 0.4.3
status: New → Confirmed
Revision history for this message
Pieter Van Dyck (vandyck-pieter) wrote : Re: [Bug 487138] Re: Python files with a name starting with '.' are not analysed but pythoscope still tries to build tests for it.

2009/11/23 Michal Kwiatkowski <email address hidden>:
> Pythoscope failed because of an exception, that is a bug and I'll fix
> that.
>
> Another issue is whether Pythoscope should inspect modules that it
> ignored earlier but were explicitly specified on the command line. I
> would say yes, it should do that. In your particular case pythoscope
> should notice that ".my_cool_class.py" wasn't inspected earlier, so it
> should inspect it and then generate tests for it. Do you think that's a
> good solution?

Yes, or if Pythoscope can't inspect an entity for some reason, it
should not try to generate a test and log that fact.
It would also be nice if the initial inspection would log the fact
that it is ignoring things.

Note that although my testcase is a valid python script, it is not a
valid module: it can not be imported due to restrictions on Python
names.

Revision history for this message
Michal Kwiatkowski (ruby) wrote :

Fixed in trunk r316.

I went the "ignore and inform" way. Modules with names starting with a dot will still be ignored, but when you try to generate tests for them, you'll get a warning: "Failed to inspect module .mod.py, skipping test generation." In any case, Pythoscope shouldn't die now.

Changed in pythoscope:
assignee: nobody → Michal Kwiatkowski (ruby)
status: Confirmed → Fix Committed
Changed in pythoscope:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.