summary refs log tree commit diff
diff options
context:
space:
mode:
authorJaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com>2015-03-14 20:25:37 +0100
committerJaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com>2015-03-14 20:25:37 +0100
commit4d1652484f4a81b8d014159e680f7e20feae85e1 (patch)
tree702c3098d4aa8dade126d2613c3d2d28797dddb9
parent88cf6fb3685c4e012c9f574cbc5f1836c42fc06d (diff)
downloadyoutube-dl-4d1652484f4a81b8d014159e680f7e20feae85e1.tar.gz
youtube-dl-4d1652484f4a81b8d014159e680f7e20feae85e1.tar.xz
youtube-dl-4d1652484f4a81b8d014159e680f7e20feae85e1.zip
[test/unicode_literals] Don't look into the .git and .tox directories
The .tox directory contains python code that we can't control
-rw-r--r--test/test_unicode_literals.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/test/test_unicode_literals.py b/test/test_unicode_literals.py
index 7f816698e..6c1b7ec91 100644
--- a/test/test_unicode_literals.py
+++ b/test/test_unicode_literals.py
@@ -17,13 +17,22 @@ IGNORED_FILES = [
     'buildserver.py',
 ]
 
+IGNORED_DIRS = [
+    '.git',
+    '.tox',
+]
 
 from test.helper import assertRegexpMatches
 
 
 class TestUnicodeLiterals(unittest.TestCase):
     def test_all_files(self):
-        for dirpath, _, filenames in os.walk(rootDir):
+        for dirpath, dirnames, filenames in os.walk(rootDir):
+            for ignore_dir in IGNORED_DIRS:
+                if ignore_dir in dirnames:
+                    # If we remove the directory from dirnames os.walk won't
+                    # recurse into it
+                    dirnames.remove(ignore_dir)
             for basename in filenames:
                 if not basename.endswith('.py'):
                     continue