On Thu, Jan 28, 2016 at 5:09 PM, Martin A. Brown <mar...@linux-ip.net> wrote:
> I'll add one option to the mix, and summarize the other options I saw listed > earlier. > > Option A (tempfile): > > Create a directory and copy your pristine tree into the directory > and make the base directory for the important data files configurable. > Also known as parameterization. > > Option B (starting with Danny's sample code) > > Create the objects to emulate whatever filesystem behaviour you need. > > Option C (use pyfakefs): > > Use pyfakefs, which acts like a filesystem for testing purposes. > https://pypi.python.org/pypi/pyfakefs > https://github.com/jmcgeheeiv/pyfakefs > > Option D (use StringIO): > > If you are less concerned about filesystem interactions and really > just want an individual thingy that that behaves like a file, but > can be constructed in memory, use StringIO (or cStringIO). Isn't option D what Danny was using to make option B? Or are you saying keep things even simpler? boB _______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor