Merge pull request #909 from ZyX-I/pypy-support

Enable pypy tests in .travis.yml
This commit is contained in:
Nikolai Aleksandrovich Pavlov 2014-07-10 20:00:59 +04:00
commit 0810f394f5
4 changed files with 11 additions and 6 deletions

View File

@ -5,6 +5,7 @@ python:
- "3.2" - "3.2"
- "3.3" - "3.3"
- "3.4" - "3.4"
- "pypy"
install: tests/install.sh install: tests/install.sh
script: tests/test.sh script: tests/test.sh

View File

@ -46,17 +46,17 @@ def load_inotify():
# inotify_add_watch() # inotify_add_watch()
prototype = ctypes.CFUNCTYPE(ctypes.c_int, ctypes.c_int, ctypes.c_char_p, ctypes.c_uint32, use_errno=True) prototype = ctypes.CFUNCTYPE(ctypes.c_int, ctypes.c_int, ctypes.c_char_p, ctypes.c_uint32, use_errno=True)
add_watch = prototype(('inotify_add_watch', libc), ( add_watch = prototype(('inotify_add_watch', libc), (
(1, "fd"), (1, "pathname"), (1, "mask")), use_errno=True) (1, "fd"), (1, "pathname"), (1, "mask")))
# inotify_rm_watch() # inotify_rm_watch()
prototype = ctypes.CFUNCTYPE(ctypes.c_int, ctypes.c_int, ctypes.c_int, use_errno=True) prototype = ctypes.CFUNCTYPE(ctypes.c_int, ctypes.c_int, ctypes.c_int, use_errno=True)
rm_watch = prototype(('inotify_rm_watch', libc), ( rm_watch = prototype(('inotify_rm_watch', libc), (
(1, "fd"), (1, "wd")), use_errno=True) (1, "fd"), (1, "wd")))
# read() # read()
prototype = ctypes.CFUNCTYPE(ctypes.c_ssize_t, ctypes.c_int, ctypes.c_void_p, ctypes.c_size_t, use_errno=True) prototype = ctypes.CFUNCTYPE(ctypes.c_ssize_t, ctypes.c_int, ctypes.c_void_p, ctypes.c_size_t, use_errno=True)
read = prototype(('read', libc), ( read = prototype(('read', libc), (
(1, "fd"), (1, "buf"), (1, "count")), use_errno=True) (1, "fd"), (1, "buf"), (1, "count")))
_inotify = (init1, add_watch, rm_watch, read) _inotify = (init1, add_watch, rm_watch, read)
return _inotify return _inotify

View File

@ -3,8 +3,10 @@ pip install .
pip install psutil pip install psutil
if python -c 'import sys; sys.exit(1 * (sys.version_info[0] != 2))' ; then if python -c 'import sys; sys.exit(1 * (sys.version_info[0] != 2))' ; then
# Python 2 # Python 2
pip install mercurial if python -c 'import platform, sys; sys.exit(1 - (platform.python_implementation() == "CPython"))' ; then
pip install --allow-external bzr --allow-unverified bzr bzr pip install mercurial
pip install --allow-external bzr --allow-unverified bzr bzr
fi
if python -c 'import sys; sys.exit(1 * (sys.version_info[1] >= 7))' ; then if python -c 'import sys; sys.exit(1 * (sys.version_info[1] >= 7))' ; then
# Python 2.6 # Python 2.6
pip install unittest2 argparse pip install unittest2 argparse

View File

@ -13,6 +13,7 @@ import threading
import os import os
import sys import sys
import re import re
import platform
from time import sleep from time import sleep
from subprocess import call, PIPE from subprocess import call, PIPE
from functools import partial from functools import partial
@ -466,7 +467,8 @@ class TestFilesystemWatchers(TestCase):
os.rename(f, f + '1') os.rename(f, f + '1')
changed() changed()
use_mercurial = use_bzr = sys.version_info < (3, 0) use_mercurial = use_bzr = (sys.version_info < (3, 0)
and platform.python_implementation() == 'CPython')
class TestVCS(TestCase): class TestVCS(TestCase):