Skip to content

Commit ff1c217

Browse files
committed
update readme with rst for pypi
1 parent cba9546 commit ff1c217

File tree

5 files changed

+93
-53
lines changed

5 files changed

+93
-53
lines changed

MANIFEST.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
include MANIFEST.in
2-
include *.md
2+
include README.rst CONTRIBUTING.rst

README.md

Lines changed: 0 additions & 50 deletions
This file was deleted.

README.rst

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
===================
2+
agent-python-pytest
3+
===================
4+
5+
6+
**Important:** this is draft version under development.
7+
8+
Pytest plugin for reporting test results of Pytest to the 'Reportal Portal'.
9+
10+
Usage
11+
-----
12+
13+
Installation
14+
~~~~~~~~~~~~
15+
16+
To install pytest plugin execute next command in a terminal:
17+
18+
.. code-block:: bash
19+
20+
pip install pytest-reportportal
21+
22+
23+
Configuration
24+
~~~~~~~~~~~~~
25+
26+
Prepare the config file :code:`pytest.ini` in root directory of tests or specify
27+
any one using pytest command line option:
28+
29+
.. code-block:: bash
30+
31+
py.test -c config.cfg
32+
33+
34+
The :code:`pytest.ini` file should have next mandatory fields:
35+
36+
- :code:`rp_uuid` - number could be found in the User profile section
37+
- :code:`rp_project` - name of project in Report Potal
38+
- :code:`rp_endpoint` - address of Report Portal Server
39+
40+
Example of :code:`pytest.ini`:
41+
42+
.. code-block:: text
43+
44+
[pytest]
45+
rp_uuid = uuid Report Portal
46+
rp_endpoint = http://ip:port
47+
rp_project = Project of Report Portal
48+
49+
Also launch tags could be added, but this parapmeter is not
50+
mandatory :code:`rp_launch_tags = 'PyTest' 'Report_Portal'`.
51+
52+
53+
Logging
54+
~~~~~~~
55+
56+
For logging of the test item flow to Report Portal, please, use the python
57+
logging handler privided by plugin like bellow:
58+
59+
.. code-block:: python
60+
61+
# Import Report Portal handler in the test module.
62+
from pytest_reportportal import RPlogHandler
63+
# Get logger.
64+
logger = logging.getLogger()
65+
# Create hanler, set log level add it to the logger.
66+
rp_handler = RPlogHandler()
67+
rp_handler.setLevel(logging.INFO)
68+
logger.addHandler(rp_handler)
69+
# In this case only INFO messages will be sent to the Report Portal.
70+
def test_one(self):
71+
logger.info("Case1. Step1")
72+
x = "this"
73+
logger.info("Case1. Step2")
74+
assert 'h' in x
75+
76+
77+
Launching
78+
~~~~~~~~~
79+
80+
To run test with Report Portal you need to specify neme of :code:`launch`:
81+
82+
.. code-block:: bash
83+
84+
py.test ./tests --rp-launch AnyLaunchName
85+
86+
87+
Copyright Notice
88+
----------------
89+
Licensed under the [GPLv3](https://www.gnu.org/licenses/quick-guide-gplv3.html)
90+
license (see the LICENSE file).

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
[metadata]
2-
description-file = README.md
2+
description-file = README.rst

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def read_file(fname):
1616
name="pytest-reportportal",
1717
version=version,
1818
description="Agent for Reproting results of tests to the Report Portal server",
19-
long_description=read_file("README.md") + "\n\n",
19+
long_description=read_file("README.rst") + "\n\n",
2020
author="Pavel Papou",
2121
author_email="[email protected]",
2222
url="https://github.com/reportportal/agent-python-pytest",

0 commit comments

Comments
 (0)