def wantDirectory(self, dirname):
tail = op_basename(dirname)<EOL>if ispackage(dirname):<EOL><INDENT>wanted = (not self.exclude<EOL>or not filter(None,<EOL>[exc.search(tail) for exc in self.exclude]<EOL>))<EOL><DEDENT>else:<EOL><INDENT>wanted = (self.matches(tail)<EOL>or (self.config.srcDirs<EOL>and tail in self.config.srcDirs))<EOL><DEDENT>plug_wants = self.plugins.wantDirectory(dirname)<EOL>if plug_wants is not None:<EOL><INDENT>log.debug("<STR_LIT>",<EOL>dirname, plug_wants)<EOL>wanted = plug_wants<EOL><DEDENT>log.debug("<STR_LIT>", dirname, wanted)<EOL>return wanted<EOL>
Is the directory a wanted test directory?

        All package directories match, so long as they do not match exclude. 
        All other directories must match test requirements.