Why does the unit test fail of the pyPDF2 package?

Steven D'Aprano steve at pearwood.info
Wed Jun 24 13:35:12 EDT 2015


On Thu, 25 Jun 2015 02:53 am, fl wrote:

> Hi,
> I want to learn some coding on PDF. After I download and install pyPDF2,
> it cannot pass unit test, which is coming from the package.
> 
> I put a screen shot link here to show the console message:

Please don't use screen shots:

(1) We cannot copy and paste text from a screen shot.

(2) Blind people and those with poor vision may not be able to see the
screen shot, and their screen readers do not work on images.

(3) People may be reading your post via email or news, and not be able to
access the website containing the screen shot.

Instead, copy and paste the text from the console and include it in the body
of your message. Do you know how to copy text from the Windows console?


> http://tinypic.com/view.php?pic=fbdpg0&s=8#.VYre8_lVhBc
> 
> [IMG]http://i57.tinypic.com/fbdpg0.png[/IMG]


Have you read the test failure? It is obvious why it failed. Your test
expects to get:

"TheCrazyOnesOctober14,1998Herestothecrazyones..."

but instead gets:

"TheCrazyOnes\nOctober14,1998\nHerestothecrazyones..."

The difference is obvious. Your expected output doesn't include newlines.




-- 
Steven




More information about the Python-list mailing list