Skip to content

Commit 12e18b5

Browse files
authored
Merge pull request #302 from reportportal/5.1
5.1
2 parents de7a3c3 + c7a5937 commit 12e18b5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+2391
-1430
lines changed

README.rst

Lines changed: 2 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,6 @@ Example of :code:`pytest.ini`:
8484
rp_launch = AnyLaunchName
8585
rp_launch_attributes = 'PyTest' 'Smoke'
8686
rp_launch_description = 'Smoke test'
87-
rp_ignore_errors = True
8887
rp_ignore_attributes = 'xfail' 'usefixture'
8988
9089
- The :code:`rp_uuid` can also be set with the environment variable `RP_UUID`. This will override the value set for :code:`rp_uuid` in pytest.ini
@@ -101,21 +100,15 @@ The following parameters are optional:
101100
by pytest --rp-launch-description option, default value is '')
102101

103102
- :code:`rp_log_batch_size = 20` - size of batch log request
104-
- :code:`rp_ignore_errors = True` - Ignore Report Portal errors (exit otherwise)
105103
- :code:`rp_ignore_attributes = 'xfail' 'usefixture'` - Ignore specified pytest markers
106104
- :code:`rp_is_skipped_an_issue = False` - Treat skipped tests as required investigation. Default is True.
107-
- :code:`rp_hierarchy_dirs = True` - Enables hierarchy for tests directories, default `False`. Doesn't support 'xdist' plugin.
108-
- :code:`rp_hierarchy_module = True` - Enables hierarchy for module, default `True`. Doesn't support 'xdist' plugin.
109-
- :code:`rp_hierarchy_class = True` - Enables hierarchy for class, default `True`. Doesn't support 'xdist' plugin.
110-
- :code:`rp_hierarchy_parametrize = True` - Enables hierarchy parametrized tests, default `False`. Doesn't support 'xdist' plugin.
111105
- :code:`rp_hierarchy_dirs_level = 0` - Directory starting hierarchy level (from pytest.ini level) (default `0`)
112-
- :code:`rp_issue_marks = 'xfail' 'issue'` - Pytest marks that could be used to get issue information (id, type, reason)
106+
- :code:`rp_hierarchy_dirs = True` - Enables hierarchy for tests directories, default `False`. Doesn't support 'xdist' plugin.
107+
- :code:`rp_hierarchy_dir_path_separator` - Path separator to display directories in test hierarchy. In case of empty value current system path separator will be used (os.path.sep)
113108
- :code:`rp_issue_system_url = https://bugzilla.some.com/show_bug.cgi?id={issue_id}` - issue URL (issue_id will be filled by parameter from pytest mark)
114109
- :code:`rp_issue_id_marks = True` - Enables adding marks for issue ids (e.g. "issue:123456")
115110
- :code:`rp_verify_ssl = True` - Verify SSL when connecting to the server
116-
- :code:`rp_display_suite_test_file = True` - In case of True, include the suite's relative file path in the launch name as a convention of "<RELATIVE_FILE_PATH>::<SUITE_NAME>". In case of False, set the launch name to be the suite name only - this flag is relevant only when "rp_hierarchy_module" flag is set to False
117111
- :code:`rp_mode = DEFAULT` - DEBUG or DEFAULT launch mode. DEBUG launches are displayed in a separate tab and not visible to anyone except owner
118-
- :code:`rp_hierarchy_dir_path_separator` - Path separator to display directories in test hierarchy. In case of empty value current system path separator will be used
119112

120113

121114
If you like to override the above parameters from command line, or from CI environment based on your build, then pass
@@ -246,23 +239,8 @@ Send attachement (screenshots)
246239
https://github.com/reportportal/client-Python#send-attachement-screenshots
247240

248241

249-
250242
Troubleshooting
251243
~~~~~~~~~~~~~~~
252-
253-
In case you have connectivity issues (or similar problems) with Report Portal,
254-
it's possible to ignore exceptions raised by :code:`pytest_reportportal` plugin.
255-
For this, please, add following option to :code:`pytest.ini` configuration file.
256-
257-
.. code-block:: text
258-
259-
[pytest]
260-
...
261-
rp_ignore_errors = True
262-
263-
With option above all exceptions raised by Report Portal will be printed out to
264-
`stderr` without causing test failures.
265-
266244
If you would like to temporary disable integrations with Report Portal just
267245
deactivate :code:`pytest_reportportal` plugin with command like:
268246

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Copyright (c) 2022 https://reportportal.io .
2+
# Licensed under the Apache License, Version 2.0 (the "License");
3+
# you may not use this file except in compliance with the License.
4+
# You may obtain a copy of the License at
5+
#
6+
# https://www.apache.org/licenses/LICENSE-2.0
7+
#
8+
# Unless required by applicable law or agreed to in writing, software
9+
# distributed under the License is distributed on an "AS IS" BASIS,
10+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
# See the License for the specific language governing permissions and
12+
# limitations under the License
13+
14+
import pytest
15+
16+
17+
@pytest.mark.scope("smoke")
18+
def test_custom_attributes_report():
19+
"""
20+
This is a test with one custom markers which shall appear on
21+
ReportPortal on test's item
22+
"""
23+
assert True
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Copyright (c) 2022 https://reportportal.io .
2+
# Licensed under the Apache License, Version 2.0 (the "License");
3+
# you may not use this file except in compliance with the License.
4+
# You may obtain a copy of the License at
5+
#
6+
# https://www.apache.org/licenses/LICENSE-2.0
7+
#
8+
# Unless required by applicable law or agreed to in writing, software
9+
# distributed under the License is distributed on an "AS IS" BASIS,
10+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
# See the License for the specific language governing permissions and
12+
# limitations under the License
13+
14+
import pytest
15+
16+
17+
@pytest.mark.scope("smoke")
18+
@pytest.mark.scope("regression")
19+
def test_custom_attributes_report():
20+
"""
21+
This is a test with multiple custom markers which shall appear on
22+
ReportPortal on test's item as different attributes
23+
"""
24+
assert True

examples/empty/README.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
A placeholder file for git
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
"""A simple example test with different parameter types."""
2+
import pytest
3+
4+
5+
@pytest.mark.parametrize(
6+
['integer', 'floating_point', 'boolean', 'none'], [(1, 1.5, True, None)]
7+
)
8+
def test_in_class_parameterized(integer, floating_point, boolean, none):
9+
"""
10+
This is my test with different parameter types.
11+
"""
12+
assert True

examples/skip/__init__.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Copyright (c) 2022 https://reportportal.io .
2+
# Licensed under the Apache License, Version 2.0 (the "License");
3+
# you may not use this file except in compliance with the License.
4+
# You may obtain a copy of the License at
5+
#
6+
# https://www.apache.org/licenses/LICENSE-2.0
7+
#
8+
# Unless required by applicable law or agreed to in writing, software
9+
# distributed under the License is distributed on an "AS IS" BASIS,
10+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
# See the License for the specific language governing permissions and
12+
# limitations under the License

examples/skip/test_simple_skip.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
"""Simple example skipped test."""
2+
# Copyright (c) 2022 https://reportportal.io .
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# https://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License
14+
import pytest
15+
16+
17+
@pytest.mark.skip(reason='no way of currently testing this')
18+
def test_simple_skip():
19+
assert False

examples/skip/test_skip_issue.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
"""Simple example skipped test."""
2+
# Copyright (c) 2022 https://reportportal.io .
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# https://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License
14+
import pytest
15+
16+
ID = 'ABC-1234'
17+
REASON = 'some_bug'
18+
TYPE = 'PB'
19+
20+
21+
@pytest.mark.issue(issue_id=ID, reason=REASON, issue_type=TYPE)
22+
@pytest.mark.skip(reason='no way of currently testing this')
23+
def test_simple_skip():
24+
assert False

examples/test_case_id/__init__.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
"""This package contains Test Case ID integration test examples.
2+
3+
Copyright (c) 2022 https://reportportal.io .
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
https://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License
15+
"""

0 commit comments

Comments
 (0)