Why does the unit test fail of the pyPDF2 package?

Steven D'Aprano steve at pearwood.info
Wed Jun 24 21:20:28 EDT 2015


On Thu, 25 Jun 2015 03:52 am, fl wrote:

> Thanks, Steven. I don't know how to copy command console window contents
> to the forum post.

I don't know either, because I don't use Windows, but you can google for
instructions:

https://duckduckgo.com/html/?q=copy+text+windows+console

https://startpage.com/do/search?q=copy+text+windows+console

http://www.bing.com/search?q=copy+text+windows+console

http://au.search.yahoo.com/search?p=copy+text+windows+console

Even Google works:

https://www.google.com.au/search?q=copy+text+windows+console


> Yes, there are extra '\n' in the extracted, but I don't know how to
> suppress it. Does anyone know how to make it the same of the expected?

Where you enter the expected output, instead of entering:

"TheCrazyOnesOctober14,1998Herestothecrazyones..."

instead enter:

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


The point is that your expected output should contain the text actually in
the PDF file. If your expected output is different from the actual
contents, then the expectations are wrong, not your code. The test itself
is buggy.



-- 
Steven




More information about the Python-list mailing list