Skip to content

Commit 9950dff

Browse files
authored
Merge pull request #8 from krasoffski/docfixes
Update README file to rst format for pypi.python.org registry.
2 parents bc70d8a + 137dfa5 commit 9950dff

File tree

5 files changed

+96
-53
lines changed

5 files changed

+96
-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: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
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 = fb586627-32be-47dd-93c1-678873458a5f
46+
rp_endpoint = http://192.168.1.10:8080
47+
rp_project = user_personal
48+
rp_launch_tags = 'PyTest' 'Smoke'
49+
50+
Also launch tags could be added, but this parapmeter is not
51+
mandatory :code:`rp_launch_tags = 'PyTest' 'Report_Portal'`.
52+
53+
54+
Logging
55+
~~~~~~~
56+
57+
For logging of the test item flow to Report Portal, please, use the python
58+
logging handler privided by plugin like bellow:
59+
60+
.. code-block:: python
61+
62+
# Import Report Portal handler in the test module.
63+
from pytest_reportportal import RPlogHandler
64+
# Get logger.
65+
logger = logging.getLogger()
66+
# Create hanler, set log level add it to the logger.
67+
rp_handler = RPlogHandler()
68+
rp_handler.setLevel(logging.INFO)
69+
logger.addHandler(rp_handler)
70+
# In this case only INFO messages will be sent to the Report Portal.
71+
def test_one(self):
72+
logger.info("Case1. Step1")
73+
x = "this"
74+
logger.info("Case1. Step2")
75+
assert 'h' in x
76+
77+
78+
Launching
79+
~~~~~~~~~
80+
81+
To run test with Report Portal you need to specify neme of :code:`launch`:
82+
83+
.. code-block:: bash
84+
85+
py.test ./tests --rp-launch AnyLaunchName
86+
87+
88+
Copyright Notice
89+
----------------
90+
91+
Licensed under the GPLv3_ license (see the LICENSE file).
92+
93+
.. _GPLv3: https://www.gnu.org/licenses/quick-guide-gplv3.html

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)