Skip to content

Commit 13522c4

Browse files
authored
Convert LocalPath objects to strings
1 parent 8a6c2fd commit 13522c4

File tree

5 files changed

+14
-17
lines changed

5 files changed

+14
-17
lines changed

.travis.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ python:
1010
- "3.7"
1111
- "3.8"
1212
install:
13-
- pip install pycodestyle pydocstyle pytest delayed-assert requests reportportal-client dill
13+
- pip install -r requirements.txt
14+
- pip install pycodestyle pydocstyle delayed-assert requests
1415
before_script:
1516
- pycodestyle .
1617
- pydocstyle .

pytest_reportportal/service.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ def start_pytest_item(self, test_item=None):
293293
'start_time': timestamp(),
294294
'item_type': 'SUITE',
295295
'parent_item_id': self.parent_item_id,
296-
'code_ref': test_item.fspath
296+
'code_ref': str(test_item.fspath)
297297
}
298298
log.debug('ReportPortal - Start Suite: request_body=%s', payload)
299299
item_id = self.rp.start_test_item(**payload)
@@ -311,7 +311,7 @@ def start_pytest_item(self, test_item=None):
311311
'start_time': timestamp(),
312312
'item_type': 'STEP',
313313
'parent_item_id': self.parent_item_id,
314-
'code_ref': '{0} - {1}'.format(test_item.fspath, test_item.name)
314+
'code_ref': '{0}:{1}'.format(test_item.fspath, test_item.name)
315315
}
316316
if self.rp_supports_parameters:
317317
start_rq['parameters'] = self._get_parameters(test_item)

requirements.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
dill>=0.2.7.1
2+
pytest>=3.0.7
3+
reportportal-client>=5.0.3
4+
six>=1.13.0

setup.py

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
from setuptools import setup
66

77

8+
__version__ = '5.0.5'
9+
10+
811
def read_file(fname):
912
"""
1013
Read file.
@@ -16,27 +19,16 @@ def read_file(fname):
1619
return f.read()
1720

1821

19-
version = '5.0.4'
20-
21-
22-
requirements = [
23-
'reportportal-client>=5.0.3',
24-
'pytest>=3.0.7',
25-
'six>=1.10.0',
26-
'dill>=0.2.7.1',
27-
]
28-
29-
3022
setup(
3123
name='pytest-reportportal',
32-
version=version,
24+
version=__version__,
3325
description='Agent for Reporting results of tests to the Report Portal',
3426
long_description=read_file('README.rst'),
3527
long_description_content_type='text/markdown',
3628
author_email='[email protected]',
3729
url='https://github.com/reportportal/agent-python-pytest',
3830
packages=['pytest_reportportal'],
39-
install_requires=requirements,
31+
install_requires=read_file('requirements.txt').splitlines(),
4032
license='Apache 2.0',
4133
keywords=['testing', 'reporting', 'reportportal', 'pytest'],
4234
classifiers=[

tests/test_service.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,5 +98,5 @@ def __iter__(self):
9898

9999
expect(mocked_item_start.call_count == 1, 'One HTTP POST sent')
100100
code_ref = mocked_item_start.call_args[1]['code_ref']
101-
expect(code_ref == '/path/to/test - test_item')
101+
expect(code_ref == '/path/to/test:test_item')
102102
assert_expectations()

0 commit comments

Comments
 (0)