Skip to content

Commit

Permalink
Test(test3): On w32 PY2 and PY3 have different error codes
Browse files Browse the repository at this point in the history
  • Loading branch information
phdru committed Jun 26, 2018
1 parent 8a3e640 commit 02a9a99
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions tests/test_3_errorno_enoent.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
import os, time, errno
import sys, os, time, errno
from utils import *
from fsmonitor import *
from fsmonitor.compat import PY3

def test_3_errorno_enoent():
fsm_test = FSMonitorTest()
err_code = errno.ENOENT
if PY3 and sys.platform == "win32":
err_code = errno.ESRCH
try:
fsm_test.add_dir_watch("/this/path/does/not/exist")
except FSMonitorError as e:
assert e.errno == errno.ENOENT
assert e.errno == err_code
else:
assert False, "Expected exception"

0 comments on commit 02a9a99

Please sign in to comment.