Skip to content

DingusTestCase should replace file, open, etc. #1

@garybernhardt

Description

@garybernhardt

Imported from BitBucket:

Reported by Gary Bernhardt / garybernhardt, created about a year ago.

Off the top of my head, this should include file, open, exec, and execfile. There may be more. Check the builtin module.

Ryan Freckleton / ryan_freckleton

Looking through builtin it looks like the following should be mocked (they talk to the 'outside' either through the file system or stdin):
file
eval
open
execfile
input
raw_input
There are also a couple functions associated with the import machinery, import and reload, but I can't think of how to mock those in a way that will work correctly all of the time.

Gary Bernhardt / garybernhardt

Thanks for looking through the builtins, Ryan! That will make it much easier to add them to DingusTestCase. I'm much less worried about import and reload than the others you listed. If classes and functions under test are importing code within themselves, there are probably bigger problems in the system than having well-stubbed unit tests. :)
Spam

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions