Skip to content

Commit

Permalink
Green will now skip virtualenv directories during discovery, making i…
Browse files Browse the repository at this point in the history
…t save to let green discover tests in a project that has one or more virtualenv directories inside of it.
  • Loading branch information
CleanCut committed Jun 17, 2015
1 parent 962d6bb commit aa97c2c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions green/loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,8 +218,8 @@ def discover(current_path, file_pattern='test*.py'):
suite = GreenTestSuite()
for file_or_dir_name in sorted(os.listdir(current_abspath)):
path = os.path.join(current_abspath, file_or_dir_name)
# Recurse into directories
if os.path.isdir(path):
# Recurse into directories, attempting to skip virtual environments
if os.path.isdir(path) and not os.path.isfile(os.path.join(path, 'bin', 'activate')):
subdir_suite = discover(path, file_pattern=file_pattern)
if subdir_suite:
suite.addTest(subdir_suite)
Expand Down

0 comments on commit aa97c2c

Please sign in to comment.