Skip to content
This repository has been archived by the owner on Sep 18, 2021. It is now read-only.

Commit

Permalink
Modified setup.py and README.md.
Browse files Browse the repository at this point in the history
  • Loading branch information
yni6 committed May 12, 2015
1 parent 2043a80 commit 3a8a30a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
8 changes: 4 additions & 4 deletions README.md
Expand Up @@ -303,7 +303,7 @@ def test_data_driven(self, **param):
print('userid: %d, passwd: %s' % (param['userid'], param['passwd']))
```

Results: same results as using <code>unishark.data_driven</code>, but running with different inputs in separate threads, up to 2 threads are spawned.
Results: same results as using <code>unishark.data_driven</code>, but up to 2 threads are spawned, each running the test with a set of inputs (userid, passwd).

Multi-threads data-driven in 'args style':
```python
Expand All @@ -312,12 +312,12 @@ def test_data_driven(self, **param):
sleep(param['time'])
```

Results: it spawns up to 5 threads to run the test with 10 inputs concurrently (only sleep 1 sec in each thread).
Results: 5 threads are spawned to run the test with 10 sets of inputs concurrently (only sleep 1 sec in each thread).
It takes about 2 sec in total (10 sec if using <code>unishark.data_driven</code>) to run.

**NOTE**: It is user's responsibility to ensure thread-safe within the test method which is decorated by <code>unishark.multi_threading_data_driven</code>.
If exceptions are thrown in one or more threads, the exceptions information will be collected and summarized in the "main" thread in the end and thrown as <code>unishark.exception.MultipleErrors</code>.

If exceptions are thrown in one or more threads, the exceptions information will be collected and summarized in the "main" thread and thrown as <code>unishark.exception.MultipleErrors</code>.

<a name="Advanced_Usage"></a>
## Advanced Usage
Expand Down
12 changes: 11 additions & 1 deletion setup.py
@@ -1,5 +1,6 @@
from setuptools import setup, find_packages
from os import path
from sys import version_info

NAME = 'unishark'
VERSION = '0.2.1'
Expand All @@ -9,6 +10,15 @@
open(path.join('docs', 'CHANGELOG.rst'), 'r').read()
)

py3_requires = ['Jinja2>=2.7.2', 'MarkupSafe>=0.23']
py2_requires = ['Jinja2>=2.7.2', 'MarkupSafe>=0.23', 'futures>=2.2.0']

requires = None
if version_info[0] >= 3 and version_info[1] >= 2:
requires = py3_requires
else:
requires = py2_requires

setup(
name=NAME,
version=VERSION,
Expand Down Expand Up @@ -44,7 +54,7 @@
keywords='unittest extension test reports config utility',

# See https://packaging.python.org/en/latest/requirements.html
install_requires=['Jinja2>=2.7.2', 'MarkupSafe>=0.23', 'futures>=2.2.0'],
install_requires=requires,

extras_require={
'test': ['coveralls'],
Expand Down

0 comments on commit 3a8a30a

Please sign in to comment.