Skip to content

Commit

Permalink
fix py23 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
adolli committed Apr 24, 2018
1 parent e82e4c0 commit 816e23f
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 3 deletions.
27 changes: 27 additions & 0 deletions .travis.yml
@@ -0,0 +1,27 @@
group: travis_latest
language: python
cache: pip
python:
- 2.7
- 3.6
#- nightly
#- pypy
#- pypy3
matrix:
allow_failures:
- python: nightly
- python: pypy
- python: pypy3
install:
- pip install -r requirements.txt
- pip install flake8 # pytest # add another testing frameworks later
before_script:
# stop the build if there are Python syntax errors or undefined names
- flake8 . --count --select=E901,E999,F821,F822,F823 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
- flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
script:
- true # pytest --capture=sys # add other tests here
notifications:
on_success: change
on_failure: change # `always` will be the setting once code changes slow down
5 changes: 3 additions & 2 deletions pocounit/case.py
@@ -1,5 +1,6 @@
# coding=utf-8

import six
import sys
import traceback
import unittest
Expand Down Expand Up @@ -164,7 +165,7 @@ def run(self, result=None):
emitter.start()
except Exception as e:
warnings.warn('Fail to start result emitter: "{}". Error message: \n"{}"'
.format(emitter.__class__.__name__, e.message))
.format(emitter.__class__.__name__, six.string_types(e)))

# run test
ex = None
Expand Down Expand Up @@ -202,7 +203,7 @@ def fail(self, msg=None):
except:
exc_type, e, exc_tb = sys.exc_info()
assertionRecorder.fail(msg, str(e), traceback.format_exc())
raise exc_type, msg, exc_tb
six.reraise(exc_type, exc_type(msg), exc_tb)

# assertions
def assertTrue(self, expr, msg=None):
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Expand Up @@ -11,7 +11,7 @@ def parse_requirements(filename='requirements.txt'):

setup(
name='pocounit',
version='1.0.22',
version='1.0.23',
keywords="PocoUnit unittest",
description='Unittest framework for poco and airtest',
packages=find_packages(),
Expand Down

0 comments on commit 816e23f

Please sign in to comment.