[issue9373] pulldom has low code coverage

2010-08-02 Thread Mark Smith

Mark Smith  added the comment:

Added a patch to increase code coverage for the pulldom module to 90%.

This patch also includes 3 'expectedFailure' tests that I believe indicate 
erroneous behaviour, associated with issues #9453 (SAX2DOM doesn't like 
processing instructions before the root element), and #9371 (pulldom doesn't 
provide END_DOCUMENT or COMMENT nodes)

--
keywords: +patch
Added file: http://bugs.python.org/file18324/pulldom_tests.patch

___
Python tracker 
<http://bugs.python.org/issue9373>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9454] unittest.expectedFailure decorator does not maintain target function's docstring.

2010-08-02 Thread Mark Smith

Mark Smith  added the comment:

Closed this issue. The initial report was in error -- it turns out I can't even 
read my own console. I'm an idiot :)

--
status: open -> closed

___
Python tracker 
<http://bugs.python.org/issue9454>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9454] unittest.expectedFailure decorator does not maintain target function's docstring.

2010-08-02 Thread Mark Smith

Mark Smith  added the comment:

Removed the failing test patch, because it didn't demonstrate what I thought it 
did. Unwrapped tests also don't have docstrings, because they are instances of 
the TestCase, not references to the function.

--

___
Python tracker 
<http://bugs.python.org/issue9454>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9454] unittest.expectedFailure decorator does not maintain target function's docstring.

2010-08-02 Thread Mark Smith

Changes by Mark Smith :


Removed file: http://bugs.python.org/file18321/unittest_failing_test.patch

___
Python tracker 
<http://bugs.python.org/issue9454>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9454] unittest.expectedFailure decorator does not maintain target function's docstring.

2010-08-02 Thread Mark Smith

Mark Smith  added the comment:

Provided a patch to demonstrate this issue.

Demonstrates that docstrings aren't copied to the decorator function.

--
keywords: +patch
Added file: http://bugs.python.org/file18321/unittest_failing_test.patch

___
Python tracker 
<http://bugs.python.org/issue9454>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9454] unittest.expectedFailure decorator does not maintain target function's docstring.

2010-08-02 Thread Mark Smith

New submission from Mark Smith :

When running tests with -v, the test runner prints out the docstring of each 
test method, if present, and falls back to the method name if it's not present.

Test methods wrapped with @expectedFailure do not print out their docstring, so 
it looks like the docstring is not copied to the wrapper function.

Failing test coming soon, hopefully followed by a patch to fix :)

--
components: Tests
messages: 112457
nosy: mark.smith
priority: normal
severity: normal
status: open
title: unittest.expectedFailure decorator does not maintain target function's 
docstring.
type: performance
versions: Python 3.2

___
Python tracker 
<http://bugs.python.org/issue9454>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9453] pulldom.SAX2DOM Doesn't support processing instructions before the root element

2010-08-02 Thread Mark Smith

Mark Smith  added the comment:

My recommendation is that SAX2DOM is deprecated and removed from the standard 
library rather than fixing this issue. The class is currently undocumented, has 
weird behaviour, and is unused within the Python standard library, so I don't 
expect that this will cause undue pain.

--

___
Python tracker 
<http://bugs.python.org/issue9453>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9453] pulldom.SAX2DOM Doesn't support processing instructions before the root element

2010-08-02 Thread Mark Smith

New submission from Mark Smith :

pulldom.SAX2DOM raises a TypeError if it encounters a processing instruction 
before the root element of an XML document.

It is valid to have a processing instruction before the root node of a document 
(and SAX2DOM's superclass, PullDOM supports this), so this behaviour is invalid.

I've encountered this bug while writing unit tests for pulldom (#9373), so I've 
added this as an @expectedFailure, to be submitted as a patch for that ticket.

--
components: XML
messages: 112442
nosy: mark.smith
priority: normal
severity: normal
status: open
title: pulldom.SAX2DOM Doesn't support processing instructions before the root 
element
type: behavior
versions: Python 3.2

___
Python tracker 
<http://bugs.python.org/issue9453>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7635] 19.6 xml.dom.pulldom doc: stub?

2010-07-25 Thread Mark Smith

Changes by Mark Smith :


Removed file: http://bugs.python.org/file18179/7635.patch

___
Python tracker 
<http://bugs.python.org/issue7635>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7635] 19.6 xml.dom.pulldom doc: stub?

2010-07-25 Thread Mark Smith

Mark Smith  added the comment:

Terry, thanks for the feedback!

I have added a patch, replacing the previous one, which deals with your points 
1 and 3 in the following ways:

1. I have used (an edited form of) your synopsis - I've removed the details of 
exactly what is returned from the iterator, as I thought it made the sentence 
structure slightly awkward - hope you don't mind. I've moved the old synopsis 
to the heading, which is where I intended it to be anyway.

3. I added the newline - I don't think this is really a problem, but neither is 
the fix :)

Regarding point 2: I agree with you - I struggled with whether to include 
references to these classes, eventually settling for what you see. I suppose 
they could be re-used for converting SAX events to DOM nodes, so it could be 
useful to know they are there.

SAX2DOM isn't even used internally, so is technically part of the module's 
public interface, but with such brittle behaviour that I think it should really 
be removed. It automatically adds children to their parent when they are parsed 
-- but the children will only be parsed if the buffer is large enough. If it 
isn't then you can get incorrectly empty or even partial subtrees.

--
Added file: http://bugs.python.org/file18194/7635_2.patch

___
Python tracker 
<http://bugs.python.org/issue7635>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9372] pulldom.DOMEventStream.__getitem__ is broken

2010-07-24 Thread Mark Smith

Mark Smith  added the comment:

I should have mentioned: __iter__ is already implemented, and works as expected.

--

___
Python tracker 
<http://bugs.python.org/issue9372>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9373] pulldom has low code coverage

2010-07-24 Thread Mark Smith

New submission from Mark Smith :

pulldom has poor code coverage, so I am currently implementing thorough unit 
tests for it.

--
components: XML
messages: 111476
nosy: mark.smith
priority: normal
severity: normal
status: open
title: pulldom has low code coverage
versions: Python 3.2

___
Python tracker 
<http://bugs.python.org/issue9373>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9372] pulldom.DOMEventStream.__getitem__ is broken

2010-07-24 Thread Mark Smith

New submission from Mark Smith :

DOMEventStream implements __getitem__, but ignores the index/key that is passed 
in and simply returns the next item from the stream. This is seriously 
unexpected behaviour.

I don't believe this functionality can be sensibly implemented in this class, 
and plan to submit a patch deprecating this method.

--
components: XML
messages: 111475
nosy: mark.smith
priority: normal
severity: normal
status: open
title: pulldom.DOMEventStream.__getitem__ is broken
versions: Python 3.2

___
Python tracker 
<http://bugs.python.org/issue9372>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9371] pulldom doesn't provide END_DOCUMENT or COMMENT nodes.

2010-07-24 Thread Mark Smith

New submission from Mark Smith :

I've been developing unit tests to increase the code coverage for pulldom, and 
have discovered that comments and end_document do not appear to result in 
events being obtained from the DOMEventStream.

I've attached a failing TestCase to demonstrate this.

--
components: XML
files: test_pulldom.py
messages: 111474
nosy: mark.smith
priority: normal
severity: normal
status: open
title: pulldom doesn't provide END_DOCUMENT or COMMENT nodes.
type: behavior
versions: Python 3.2
Added file: http://bugs.python.org/file18183/test_pulldom.py

___
Python tracker 
<http://bugs.python.org/issue9371>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7635] 19.6 xml.dom.pulldom doc: stub?

2010-07-24 Thread Mark Smith

Mark Smith  added the comment:

I have a patch that provides full documentation for pulldom, and adds sensible 
docstrings to the pulldom module. I have unfortunately created the patch on the 
py3k branch -- please let me know what I should do regarding porting these 
changes to Python 2.7.

--
keywords: +patch
nosy: +mark.smith
Added file: http://bugs.python.org/file18179/7635.patch

___
Python tracker 
<http://bugs.python.org/issue7635>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com