[New-bugs-announce] [issue14140] packaging tests: add helpers to create and inspect a tree of files

Éric Araujo report at bugs.python.org
Mon Feb 27 12:22:10 CET 2012

New submission from Éric Araujo <merwok at netwok.org>:

Many packaging tests use functions like os.mkdir and open to create files in order to test commands or actions, or slightly higher-level helpers like packaging.tests.support.TempdirManager.write_file.

I think this could be much more automated.  There should be an helper function which could accept a string with a custom format describing directories, files and their contents, then create the files in a temp directory and later cleans it all.  Likewise, it should be easier to check what new files are created (i.e. in the build or dist directory) and what their contents are.

My ultimate goal is to move from low-level tests which use command objects directly to higher-level tests which actually run the pysetup script and check the results, so that tests get closer to what people do.  This will also remove cruft in the tests, and let us change details more easily (because we’ll be testing behavior, not internal attributes or exact output).

assignee: eric.araujo
components: Distutils2
messages: 154453
nosy: alexis, eric.araujo, francismb, python-dev, shane.moore, tarek
priority: normal
severity: normal
stage: needs patch
status: open
title: packaging tests: add helpers to create and inspect a tree of files
type: enhancement
versions: 3rd party

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list