Skip to content
Snippets Groups Projects
Commit 36618f31 authored by Damian Johnson's avatar Damian Johnson
Browse files

Tests fail if gitignore isn't present

Good point from irl that our tests fail if the gitignore file isn't present...

  https://trac.torproject.org/projects/tor/ticket/26984

  % ./run_tests.py --all
  Traceback (most recent call last):
    File "./run_tests.py", line 36, in <module>
      import test
    File "/home/atagar/Desktop/stem/test/__init__.py", line 71, in <module>
      with open(os.path.join(STEM_BASE, '.gitignore')) as ignore_file:
  IOError: [Errno 2] No such file or directory: '/home/atagar/Desktop/stem/.gitignore'
parent 24206c3b
Branches
Tags
No related merge requests found
......@@ -67,8 +67,10 @@ NEW_CAPABILITIES_SUPPRESSION_TOKENS = set()
# File extensions of contents that should be ignored.
IGNORED_FILE_TYPES = []
GIT_IGNORE_PATH = os.path.join(STEM_BASE, '.gitignore')
with open(os.path.join(STEM_BASE, '.gitignore')) as ignore_file:
if os.path.exists(GIT_IGNORE_PATH):
with open(GIT_IGNORE_PATH) as ignore_file:
for line in ignore_file:
if line.startswith('*.'):
IGNORED_FILE_TYPES.append(line[2:].strip())
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment