-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Test(test3): On w32 PY2 and PY3 have different error codes
- Loading branch information
Showing
1 changed file
with
6 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |