Skip to content

Instantly share code, notes, and snippets.

@unbracketed
Last active December 28, 2015 11:28
Show Gist options
  • Save unbracketed/7493207 to your computer and use it in GitHub Desktop.
Save unbracketed/7493207 to your computer and use it in GitHub Desktop.
Find all __init__ modules for packages named 'tests' and clear their contents
find . \
-path "*/tests/*" \
-type f \
-name "__init__.py" \
-exec sh -c 'echo "" > {}' \;
find . \
-path "*/tests/*"
-type f
-name "*.py" \
\! -name "__init__.py"
-execdir git mv "{}" test_"{}" \;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment