andreikop / enki

A text editor for programmers
http://enki-editor.org
GNU General Public License v2.0
161 stars 38 forks source link

Fix: Make sure test file x can be removed after chmod-ing it. #206

Closed bjones1 closed 10 years ago

bjones1 commented 10 years ago

On Windows, the first run of test_open_file works (sort of), but the second fails because one of the test files (x) can't be removed. This fix allows x to be removed after each test run, so the tests succeed when run multiple times.

C:\Users\bjones\Documents\enki_all\enki\tests\test_core>python -m unittest -v test_open_file
test_1 (test_open_file.Loop) ... Traceback (most recent call last):
  File "test_open_file.py", line 72, in func
AttributeError: 'NoneType' object has no attribute 'addAction'
ok
test_2 (test_open_file.Loop) ... Traceback (most recent call last):
  File "test_open_file.py", line 85, in func
AttributeError: 'NoneType' object has no attribute 'setCurrentDocument'
ok
test_1 (test_open_file.OpenFail) ... ok
test_2 (test_open_file.OpenFail) ... ok
test_3 (test_open_file.OpenFail) ... ok
test_4 (test_open_file.OpenFail) ... ok
test_1 (test_open_file.Test) ... ok

----------------------------------------------------------------------
Ran 7 tests in 40.429s

OK

C:\Users\bjones\Documents\enki_all\enki\tests\test_core>python -m unittest -v test_open_file
test_1 (test_open_file.Loop) ... Traceback (most recent call last):
  File "test_open_file.py", line 72, in func
AttributeError: 'NoneType' object has no attribute 'addAction'
ok
test_2 (test_open_file.Loop) ... ERROR
test_1 (test_open_file.OpenFail) ... ok
test_2 (test_open_file.OpenFail) ... ok
test_3 (test_open_file.OpenFail) ... ERROR
test_4 (test_open_file.OpenFail) ... ERROR
test_1 (test_open_file.Test) ... ok

======================================================================
ERROR: test_2 (test_open_file.Loop)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "test_open_file.py", line 81, in test_2
  File "C:\Users\bjones\Documents\enki_all\enki\tests\test_core\..\base.py", lin
e 207, in createFile
    with open(path, 'wb') as file_:
IOError: [Errno 13] Permission denied: 'c:\\users\\bjones\\appdata\\local\\temp\
\enki-tests\\x'

======================================================================
ERROR: test_3 (test_open_file.OpenFail)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "test_open_file.py", line 47, in test_3
  File "C:\Users\bjones\Documents\enki_all\enki\tests\test_core\..\base.py", lin
e 207, in createFile
    with open(path, 'wb') as file_:
IOError: [Errno 13] Permission denied: 'c:\\users\\bjones\\appdata\\local\\temp\
\enki-tests\\x'

======================================================================
ERROR: test_4 (test_open_file.OpenFail)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "test_open_file.py", line 59, in test_4
  File "C:\Users\bjones\Documents\enki_all\enki\tests\test_core\..\base.py", lin
e 207, in createFile
    with open(path, 'wb') as file_:
IOError: [Errno 13] Permission denied: 'c:\\users\\bjones\\appdata\\local\\temp\
\enki-tests\\x'

----------------------------------------------------------------------
Ran 7 tests in 20.350s

FAILED (errors=3)
andreikop commented 10 years ago

Merged! Thanks

bjones1 commented 10 years ago

Did you miss a merge / rebase for this pull request? This didn't seem to make it into master, so I still get test failures.

andreikop commented 10 years ago

Hmm, I was sure I merged it. Maybe I forgot to push it from my windows pc. Merged again.

bjones1 commented 10 years ago

Thanks, that did it!