Samples don't work #4
Loading…
Reference in New Issue
There is no content yet.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may exist for a short time before cleaning up, in most cases it CANNOT be undone. Continue?
I tried both samples and found they did not work. Pull req has fixes
sample1.py
Altered the expected outputs to match what is obtained (removed elipses)
Added a repr to Parameter object so that it matches (now uses (Sumbol(x))
previous version was comparing main.x with sample1.x
add
sample2.py
Moved the ini_file_text from the main to the body, changed to a join of lists to make compatible with doctest.
Altered the expected outputs to match what is obtained (removed elipses)
Note passing ELIPSES to the doctest.testmod call does not work, you need to put # doctest: +ELIPSES on the test line.
There is still a problem.
It appers lxml and etree behave every so slightly differently.
etree adds a space on single line elements.
whereas lxml does not
This can be fixed with elipses (...)
lxml emits a CRLF at the end of the tostring() and needs a corresponding in the doctest, etree does not.
I think the answer is to always use etree for tostring even if lxml is in use as etree is in the standard library and lxml is not
Ok I think that's fixed. adding end="" to the print prevents a trailing CRLF