From 1205b8c50e427b2eea7d99d7954fe6e5e09f0883 Mon Sep 17 00:00:00 2001 From: clowwindy Date: Sat, 1 Nov 2014 12:52:51 +0800 Subject: [PATCH] skip m2crypto tests on Python 3 --- .travis.yml | 2 +- shadowsocks/crypto/m2.py | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 79a8922..b1a64df 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,7 +16,7 @@ before_install: script: - pep8 . - pyflakes . - - python tests/nose_plugin.py + - python tests/nose_plugin.py -v - python tests/test.py -c tests/aes.json - python tests/test.py -c tests/aes-ctr.json - python tests/test.py -c tests/aes-cfb1.json diff --git a/shadowsocks/crypto/m2.py b/shadowsocks/crypto/m2.py index a1d7d1c..3539711 100644 --- a/shadowsocks/crypto/m2.py +++ b/shadowsocks/crypto/m2.py @@ -80,18 +80,30 @@ def run_method(method): def test_aes_128_cfb(): + if bytes != str: + from nose.plugins.skip import SkipTest + raise SkipTest run_method(b'aes-128-cfb') def test_aes_256_cfb(): + if bytes != str: + from nose.plugins.skip import SkipTest + raise SkipTest run_method(b'aes-256-cfb') def test_bf_cfb(): + if bytes != str: + from nose.plugins.skip import SkipTest + raise SkipTest run_method(b'bf-cfb') def test_rc4(): + if bytes != str: + from nose.plugins.skip import SkipTest + raise SkipTest run_method(b'rc4')