KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I've written a specialized HTML parser, that I want to unit test with a couple of sample webpages I've downloaded. In Java, I've used class resources, to load data into unit tests, without having to rely on them being at a particular path on the file system. Is there a way to do this in Python? I found the doctest.testfile() function, but that appears to be specific to doctests. I'd like to just get a file handle, to a particular HTML file, which is relative to the current module. Thanks in advance for any suggestions!
Tags (comma-separated)
Save Edits
Cancel