Skip to content

Commit 4cd2349

Browse files
authored
Merge pull request #14 from krasoffski/docfix
Fix readme and updated email
2 parents 3c4bdd9 + 3713aa4 commit 4cd2349

File tree

4 files changed

+25
-19
lines changed

4 files changed

+25
-19
lines changed

.travis.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,9 @@ python:
55
- "3.4"
66
- "3.5"
77
- "3.6"
8+
install:
9+
- pip install pep8
10+
before_script:
11+
pep8 .
812
script:
913
- python setup.py -q install

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66
Library used only for implementors of custom listeners for ReportPortal
77

88

9-
## Allready implemented listeners:
9+
## Already implemented listeners:
1010

11-
- [Robot Framework](https://github.com/reportportal/agent-Python-RobotFramework)
1211
- [PyTest Framework](https://github.com/reportportal/agent-python-pytest)
12+
- [Robot Framework](https://github.com/reportportal/agent-Python-RobotFramework)
1313

1414

1515
## Installation
@@ -57,9 +57,9 @@ def my_error_handler(exc_info):
5757
This callback function will be called by async service client when error occurs.
5858
Return True if error is not critical and you want to continue work.
5959
:param exc_info: result of sys.exc_info() -> (type, value, traceback)
60-
:return:
60+
:return:
6161
"""
62-
print("Error occured: {}".format(exc_info[1]))
62+
print("Error occurred: {}".format(exc_info[1]))
6363
traceback.print_exception(*exc_info)
6464

6565

@@ -76,7 +76,7 @@ test = service.start_test_item(name="Test Case",
7676
description="First Test Case",
7777
tags=["Image", "Smoke"],
7878
start_time=timestamp(),
79-
item_type="TEST")
79+
item_type="STEP")
8080

8181
# Create text log message with INFO level.
8282
service.log(time=timestamp(),
@@ -89,7 +89,7 @@ service.log(time=timestamp(),
8989
level="WARN",
9090
attachment={
9191
"name": "free_memory.txt",
92-
"data": subprocess.check_output("ps".split()),
92+
"data": subprocess.check_output("free -h".split()),
9393
"mime": "text/plain"
9494
})
9595

@@ -117,7 +117,7 @@ service.finish_test_item(end_time=timestamp(), status="PASSED")
117117
service.finish_launch(end_time=timestamp())
118118

119119
# Due to async nature of the service we need to call terminate() method which
120-
# ensures all pending requests to server are proccessed.
120+
# ensures all pending requests to server are processed.
121121
# Failure to call terminate() may result in lost data.
122122
service.terminate()
123123
```

reportportal_client/service_async.py

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -97,23 +97,23 @@ def stop(self, nowait=False):
9797
This asks the thread to terminate, and then waits for it to do so.
9898
Note that if you don't call this before your application exits, there
9999
may be some records still left on the queue, which won't be processed.
100-
If nowait is False then thread will handle remaining items in queue and
100+
If nowait is False then thread will handle remaining items in queue and
101101
stop.
102-
If nowait is True then thread will be stopped even if the queue still
102+
If nowait is True then thread will be stopped even if the queue still
103103
contains items.
104104
"""
105105
self._stop.set()
106106
if nowait:
107107
self._stop_nowait.set()
108108
self.queue.put_nowait(self._sentinel_item)
109-
if (self._thread.isAlive()
110-
and self._thread is not threading.currentThread()):
109+
if (self._thread.isAlive() and
110+
self._thread is not threading.currentThread()):
111111
self._thread.join()
112112
self._thread = None
113113

114114

115115
class ReportPortalServiceAsync(object):
116-
"""Wrapper around service class to transparently provide async operations
116+
"""Wrapper around service class to transparently provide async operations
117117
to agents."""
118118

119119
BATCH_SIZE = 20
@@ -127,12 +127,13 @@ def __init__(self, endpoint, project, token, api_base="api/v1",
127127
project: project name to use for launch names.
128128
token: authorization token.
129129
api_base: defaults to api/v1, can be changed to other version.
130-
error_handler: function to be called to handle errors occured during
131-
items processing (in thread)
130+
error_handler: function to be called to handle errors occurred
131+
during items processing (in thread)
132132
"""
133133
super(ReportPortalServiceAsync, self).__init__()
134134
self.error_handler = error_handler
135-
self.rp_client = ReportPortalService(endpoint, project, token, api_base)
135+
self.rp_client = ReportPortalService(
136+
endpoint, project, token, api_base)
136137
self.log_batch = []
137138
self.supported_methods = ["start_launch", "finish_launch",
138139
"start_test_item", "finish_test_item", "log"]
@@ -157,7 +158,7 @@ def terminate(self, nowait=False):
157158
try:
158159
if not nowait:
159160
self._post_log_batch()
160-
except Exception as err:
161+
except Exception:
161162
if self.error_handler:
162163
self.error_handler(sys.exc_info())
163164
else:
@@ -201,7 +202,7 @@ def process_item(self, item):
201202
else:
202203
self._post_log_batch()
203204
getattr(self.rp_client, method)(**kwargs)
204-
except Exception as err:
205+
except Exception:
205206
if self.error_handler:
206207
if not self.error_handler(sys.exc_info()):
207208
self.terminate(nowait=True)

setup.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,11 @@
66
version='2.6.0',
77
description='Python client for Report Portal',
88
author='Artsiom Tkachou',
9-
author_email='artsiom_tkachou@epam.com',
9+
author_email='SupportEPMC-TSTReportPortal@epam.com',
1010
url='https://github.com/reportportal/client-Python',
1111
download_url='https://github.com/reportportal/client-Python/tarball/2.6.0',
12+
license='GNU General Public License v3',
1213
keywords=['testing', 'reporting', 'reportportal'],
1314
classifiers=[],
14-
install_requires=["requests>=2.4.2"],
15+
install_requires=['requests>=2.4.2'],
1516
)

0 commit comments

Comments
 (0)