Changeset 34
- Timestamp:
- Thu May 4 22:02:27 2006
- Files:
-
- branches/0.9-stable/unit_tests/test_selector.py (modified) (diff)
- branches/0.9-stable/unit_tests/test_plugins.py (modified) (diff)
- branches/0.9-stable/unit_tests/support/script.py (added)
- branches/0.9-stable/nose/core.py (modified) (diff)
- branches/0.9-stable/nose/plugins/doctests.py (modified) (diff)
- branches/0.9-stable/nose/__init__.py (modified) (diff)
- branches/0.9-stable/nose/selector.py (modified) (diff)
- branches/0.9-stable/nose/config.py (modified) (diff)
- branches/0.9-stable/examples/plugin/Example_plugin.egg-info (deleted)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
branches/0.9-stable/unit_tests/test_selector.py
r21 r34 159 159 assert not s.wantFile('setup.py') 160 160 assert not s.wantFile('/some/path/to/setup.py') 161 assert not s.wantFile('ez_setup.py') 162 assert not s.wantFile('.test.py') 163 assert not s.wantFile('_test.py') 164 assert not s.wantFile('setup_something.py') 161 165 162 166 assert s.wantFile('test.py') -
branches/0.9-stable/unit_tests/test_plugins.py
r26 r34 106 106 plug.configure(opt, conf) 107 107 108 assert plug.wantFile('foo.py') is None108 assert plug.wantFile('foo.py') 108 108 assert not plug.wantFile('bar.txt') 109 109 assert not plug.wantFile('buz.rst') … … 112 112 113 113 plug.extension = ['.txt', '.rst'] 114 assert plug.wantFile('/path/to/foo.py') is None114 assert plug.wantFile('/path/to/foo.py') 114 114 assert plug.wantFile('/path/to/bar.txt') 115 115 assert plug.wantFile('/path/to/buz.rst') … … 162 162 for test in suite: 163 163 assert str(test).endswith('doctests.txt') 164 165 def test_collect_no_collect(self): 166 # bug http://nose.python-hosting.com/ticket/55 167 # we got "iteration over non-sequence" when no files match 168 here = os.path.abspath(os.path.dirname(__file__)) 169 support = os.path.join(here, 'support') 170 plug = Doctest() 171 suite = plug.loadTestsFromPath(os.path.join(support, 'foo')) 172 for test in suite: 173 pass 174 164 175 165 176 class TestAttribPlugin(unittest.TestCase): -
branches/0.9-stable/nose/core.py
r31 r34 296 296 help="Don't make any changes to sys.path when " 297 297 "loading tests [NOSE_NOPATH]") 298 parser.add_option("--exe", action="store_false", 299 dest="ignoreExe", 300 default=not env.get('NOSE_INCLUDE_EXE'), 301 help="Look for tests in python modules that are " 302 "executable [NOSE_INCLUDE_EXE]") 298 303 299 304 # add opts from plugins … … 346 351 conf.stopOnError = options.stopOnError 347 352 conf.verbosity = options.verbosity 353 conf.ignoreExe = options.ignoreExe 348 354 349 355 if options.where is not None: -
branches/0.9-stable/nose/plugins/doctests.py
r26 r34 82 82 "(python source) not supported in this " 83 83 "version of doctest") 84 else: 85 # Don't return None, users may iterate over result 86 return [] 84 87 85 88 def matches(self, name): … … 97 100 98 101 def wantFile(self, file, package=None): 99 if file.startswith('.') or file.startswith('_'): 100 return None 102 # always want .py files 103 if file.endswith('.py'): 104 return True 105 # also want files that match my extension 101 106 if (self.extension 102 107 and anyp(file.endswith, self.extension) -
branches/0.9-stable/nose/__init__.py
r31 r34 300 300 301 301 __author__ = 'Jason Pellerin' 302 __version__ = '0.9.0a1' 303 __versioninfo__ = (0, 9, 0, 'a1') 302 __version__ = '0.9.0a2' 303 __versioninfo__ = (0, 9, 0, 'a2') 304 304 305 305 __all__ = [ -
branches/0.9-stable/nose/selector.py
r31 r34 111 111 def configure(self, conf): 112 112 self.exclude = conf.exclude 113 self.ignore = conf.ignore113 self.ignoreFiles = conf.ignoreFiles 113 113 self.include = conf.include 114 114 self.plugins = conf.plugins … … 229 229 """ 230 230 231 # never, ever load setup.py files 231 # never, ever load files that match anything in ignore 232 # (.* _* and *setup*.py by default) 232 233 base = os.path.basename(file) 233 if base == 'setup.py': 234 ignore_matches = [ ignore_this for ignore_this in self.ignoreFiles 235 if ignore_this.search(base) ] 236 if ignore_matches: 237 log.debug('%s matches ignoreFiles pattern; skipped', 238 base) 239 return False 240 241 if not self.conf.ignoreExe and os.access(file, os.X_OK): 242 log.info('%s is executable; skipped', file) 234 243 return False 235 244 … … 240 249 pysrc = ext == '.py' 241 250 242 if base.startswith('.') or base in self.ignore: 243 wanted = False 244 else: 245 wanted = pysrc and self.matches(base) 251 wanted = pysrc and self.matches(base) 246 252 plug_wants = call_plugins(self.plugins, 'wantFile', 247 253 file, package) -
branches/0.9-stable/nose/config.py
r24 r34 7 7 8 8 def __init__(self, **kw): 9 self.testMatch=re.compile(r'(?:^|[\b_\.%s-])[Tt]est' % os.sep) 10 self.addPaths=True 11 self.capture=True 12 self.detailedErrors=False 13 self.debugErrors=False 14 self.debugFailures=False 15 self.exclude=None 16 self.ignore=[] 17 self.include=None 18 self.plugins=[] 19 self.srcDirs=['lib', 'src'] 20 self.stopOnError=False 21 self.tests=[] 22 self.verbosity=1 23 self.where=None 9 self.testMatch = re.compile(r'(?:^|[\b_\.%s-])[Tt]est' % os.sep) 10 self.addPaths = True 11 self.capture = True 12 self.detailedErrors = False 13 self.debugErrors = False 14 self.debugFailures = False 15 self.exclude = None 16 self.ignoreExe = True 17 self.ignoreFiles = [ re.compile(r'^\.'), 18 re.compile(r'^_'), 19 re.compile(r'^setup\.py$') 20 ] 21 self.include = None 22 self.plugins = [] 23 self.srcDirs = ['lib', 'src'] 24 self.stopOnError = False 25 self.tests = [] 26 self.verbosity = 1 27 self.where = None 24 28 self.update(kw) 25 29 self._orig = self.__dict__.copy()
