Previous topic

music21.test.dedent

Next topic

music21.test.testDocs.test

Table Of Contents

Table Of Contents

This Page

music21.test.multiprocessTest

Multiprocess testing. Tests all doctests and Test unittest objects in all modules that are imported when running “import music21”. Runs threads on each core of a multicore system unless there are more than 2 cores, in which case it runs on n-1 cores.

N.B. this gets a slightly different set of modules than test/test.py does because the imp module is not available for threaded processing. Running both modules gives great coverage of just about everything – do that before building a new release.

Run test/testDocumentation after this.

Functions

music21.test.multiprocessTest.examplePoolRunner(testGroup=['test'], restoreEnvironmentDefaults=False)

demo of a pool runner with failures and successes...

music21.test.multiprocessTest.mainPoolRunner(testGroup=['test'], restoreEnvironmentDefaults=False, leaveOut=1)

Run all tests. Group can be test and external

music21.test.multiprocessTest.multime(multinum)
music21.test.multiprocessTest.printSummary(summaryOutput, timeStart, pathsToRun)
music21.test.multiprocessTest.runOneModuleWithoutImp(args)

ModuleGather

class music21.test.multiprocessTest.ModuleGather

Utility class for gathering and importing all modules in the music21 package. Puts them in self.modulePaths.

>>> from music21.test import testSingleCoreAll as testModule
>>> mg = testModule.ModuleGather()
>>> print mg.modulePaths[0]
D:\Web\eclipse\music21base\music21\xmlnode.py

ModuleGather methods

ModuleGather.getModuleWithoutImp(fp, restoreEnvironmentDefaults=False)

gets one module object from the file path without using Imp