Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions allure-pytest/src/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,3 @@ def pytest_collection_modifyitems(items, config):
config.option.allure_severities)

items[:] = filter(lambda item: arg_labels & set(allure_labels(item)) if arg_labels else True, items)


def pytest_namespace():
return {"allure": allure}
4 changes: 2 additions & 2 deletions allure-pytest/test/attachments/attachments_fixtures_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

@pytest.fixture
def attach_file_in_function_scope_fixture(svg_file):
allure.attach.file(svg_file, attachment_type=pytest.allure.attachment_type.SVG)
allure.attach.file(svg_file, attachment_type=allure.attachment_type.SVG)


def test_attach_file_in_function_scope_fixture(attach_file_in_function_scope_fixture):
Expand Down Expand Up @@ -44,7 +44,7 @@ def test_attach_file_in_reused_function_scope_fixture(attach_file_in_function_sc
@pytest.fixture
def attach_file_in_function_scope_finalizer(svg_file, request):
def finalizer_function_scope_fixture():
allure.attach.file(svg_file, attachment_type=pytest.allure.attachment_type.SVG)
allure.attach.file(svg_file, attachment_type=allure.attachment_type.SVG)
request.addfinalizer(finalizer_function_scope_fixture)


Expand Down
14 changes: 7 additions & 7 deletions allure-pytest/test/attachments/attachments_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def test_attach_file_from_test_with_name_and_type(xml_file):
... has_attachment(attach_type='application/xml', name='my name')
... ))
"""
allure.attach.file(xml_file, name='my name', attachment_type=pytest.allure.attachment_type.XML)
allure.attach.file(xml_file, name='my name', attachment_type=allure.attachment_type.XML)


def test_attach_data_from_test_with_name_and_type(xml_body):
Expand All @@ -45,7 +45,7 @@ def test_attach_data_from_test_with_name_and_type(xml_body):
... has_attachment(attach_type='application/xml', name='my name')
... ))
"""
allure.attach(xml_body, name='my name', attachment_type=pytest.allure.attachment_type.XML)
allure.attach(xml_body, name='my name', attachment_type=allure.attachment_type.XML)


def test_attach_file_from_test_with_user_type(xml_file):
Expand All @@ -71,7 +71,7 @@ def test_attach_data_from_test_with_user_type(xml_body):


def attach_svg_file(svg_file):
allure.attach.file(svg_file, attachment_type=pytest.allure.attachment_type.SVG)
allure.attach.file(svg_file, attachment_type=allure.attachment_type.SVG)


def test_attach_file_from_function(svg_file):
Expand All @@ -96,7 +96,7 @@ def test_many_attaches(svg_file, xml_body):
... ))
"""
attach_svg_file(svg_file)
allure.attach(xml_body, attachment_type=pytest.allure.attachment_type.XML)
allure.attach(xml_body, attachment_type=allure.attachment_type.XML)


def test_attach_from_step(svg_file, xml_body):
Expand All @@ -115,6 +115,6 @@ def test_attach_from_step(svg_file, xml_body):
... )
"""
with allure.step('Step with attachment'):
allure.attach.file(svg_file, attachment_type=pytest.allure.attachment_type.SVG)
with pytest.allure.step('Nested step with attachment'):
allure.attach(xml_body, attachment_type=pytest.allure.attachment_type.XML)
allure.attach.file(svg_file, attachment_type=allure.attachment_type.SVG)
with allure.step('Nested step with attachment'):
allure.attach(xml_body, attachment_type=allure.attachment_type.XML)
12 changes: 6 additions & 6 deletions allure-pytest/test/filtering/severity_label_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
... )) # doctest: +SKIP
"""

import pytest
import allure


@pytest.allure.severity(pytest.allure.severity_level.TRIVIAL)
@allure.severity(allure.severity_level.TRIVIAL)
def test_function_with_trivial_severity():
"""
>>> allure_report = getfixture('allure_report_with_params')('--allure-severities=trivial')
Expand All @@ -25,7 +25,7 @@ def test_function_with_trivial_severity():

class TestClass(object):

@pytest.allure.severity(pytest.allure.severity_level.TRIVIAL)
@allure.severity(allure.severity_level.TRIVIAL)
def test_method_with_trivial_severity(self):
"""
>>> allure_report = getfixture('allure_report_with_params')('--allure-severities=trivial')
Expand All @@ -37,7 +37,7 @@ def test_method_with_trivial_severity(self):
"""
pass

@pytest.allure.severity(pytest.allure.severity_level.NORMAL)
@allure.severity(allure.severity_level.NORMAL)
def test_method_with_normal_severity(self):
"""
>>> from hamcrest import not_
Expand All @@ -49,7 +49,7 @@ def test_method_with_normal_severity(self):
pass


@pytest.allure.severity(pytest.allure.severity_level.TRIVIAL)
@allure.severity(allure.severity_level.TRIVIAL)
class TestClassAgain(object):

def test_method_with_whole_class_trivial_severity(self):
Expand All @@ -63,7 +63,7 @@ def test_method_with_whole_class_trivial_severity(self):
"""
pass

@pytest.allure.severity(pytest.allure.severity_level.NORMAL)
@allure.severity(allure.severity_level.NORMAL)
def test_method_with_overridden_class_severity(self):
"""
>>> from hamcrest import not_
Expand Down
8 changes: 4 additions & 4 deletions allure-pytest/test/labels/severity/class_severity_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
"""


import pytest
import allure


@pytest.allure.severity(pytest.allure.severity_level.TRIVIAL)
@allure.severity(allure.severity_level.TRIVIAL)
class TestDecoratedClass(object):

def test_not_decorated_method(self):
Expand All @@ -26,7 +26,7 @@ def test_not_decorated_method(self):
"""
pass

@pytest.allure.severity(pytest.allure.severity_level.MINOR)
@allure.severity(allure.severity_level.MINOR)
def test_decorated_method(self):
"""
>>> allure_report = getfixture('allure_report')
Expand Down Expand Up @@ -54,7 +54,7 @@ def test_not_decorated_method(self):
"""
pass

@pytest.allure.severity(pytest.allure.severity_level.CRITICAL)
@allure.severity(allure.severity_level.CRITICAL)
def test_decorated_method(self):
"""
>>> allure_report = getfixture('allure_report')
Expand Down
4 changes: 2 additions & 2 deletions allure-pytest/test/labels/severity/function_severity_test.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import pytest
import allure


@pytest.allure.severity(pytest.allure.severity_level.MINOR)
@allure.severity(allure.severity_level.MINOR)
def test_decorated_function():
"""
>>> allure_report = getfixture('allure_report')
Expand Down
8 changes: 4 additions & 4 deletions allure-pytest/test/labels/severity/module_severity_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
... )) # doctest: +SKIP
"""

import pytest
import allure

pytestmark = pytest.allure.severity(pytest.allure.severity_level.TRIVIAL)
pytestmark = allure.severity(allure.severity_level.TRIVIAL)


def test_not_decorated_function():
Expand All @@ -24,7 +24,7 @@ def test_not_decorated_function():
pass


@pytest.allure.severity(pytest.allure.severity_level.MINOR)
@allure.severity(allure.severity_level.MINOR)
def test_decorated_function():
"""
>>> allure_report = getfixture('allure_report')
Expand All @@ -51,7 +51,7 @@ def test_method_of_not_decorated_class(self):
pass


@pytest.allure.severity(pytest.allure.severity_level.NORMAL)
@allure.severity(allure.severity_level.NORMAL)
class TestDecorated(object):

def test_method_of_decorated_class(self):
Expand Down
22 changes: 11 additions & 11 deletions allure-pytest/test/links/function_links_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
... )) # doctest: +SKIP
"""

import pytest
import allure

LINK = 'http://qameta.io'
LINK_NAME = 'QAMETA'
Expand All @@ -20,7 +20,7 @@
TEST_CASE_NAME = 'Comment with spec'


@pytest.allure.link(LINK)
@allure.link(LINK)
def test_single_link():
"""
>>> allure_report = getfixture('allure_report')
Expand All @@ -33,7 +33,7 @@ def test_single_link():
pass


@pytest.allure.link(LINK, name=LINK_NAME)
@allure.link(LINK, name=LINK_NAME)
def test_single_named_link():
"""
>>> allure_report = getfixture('allure_report')
Expand All @@ -46,7 +46,7 @@ def test_single_named_link():
pass


@pytest.allure.link(LINK, name=LINK_NAME, link_type=LINK_TYPE)
@allure.link(LINK, name=LINK_NAME, link_type=LINK_TYPE)
def test_single_named_link_with_custom_type():
"""
>>> allure_report = getfixture('allure_report')
Expand All @@ -58,7 +58,7 @@ def test_single_named_link_with_custom_type():
pass


@pytest.allure.issue(ISSUE)
@allure.issue(ISSUE)
def test_single_issue():
"""
>>> allure_report = getfixture('allure_report')
Expand All @@ -70,7 +70,7 @@ def test_single_issue():
pass


@pytest.allure.testcase(TEST_CASE)
@allure.testcase(TEST_CASE)
def test_single_test_case():
"""
>>> allure_report = getfixture('allure_report')
Expand All @@ -82,9 +82,9 @@ def test_single_test_case():
pass


@pytest.allure.link(LINK, name=LINK_NAME, link_type=LINK_TYPE)
@pytest.allure.testcase(TEST_CASE, name=TEST_CASE_NAME)
@pytest.allure.issue(ISSUE, name=ISSUE_NAME)
@allure.link(LINK, name=LINK_NAME, link_type=LINK_TYPE)
@allure.testcase(TEST_CASE, name=TEST_CASE_NAME)
@allure.issue(ISSUE, name=ISSUE_NAME)
def test_with_links_cases_and_issues():
"""
>>> allure_report = getfixture('allure_report')
Expand All @@ -98,8 +98,8 @@ def test_with_links_cases_and_issues():
pass


@pytest.allure.testcase(TEST_CASE, name="First")
@pytest.allure.testcase(ANOTHER_TEST_CASE, name="Second")
@allure.testcase(TEST_CASE, name="First")
@allure.testcase(ANOTHER_TEST_CASE, name="Second")
def test_multiply_some_type_links():
"""
>>> allure_report = getfixture('allure_report')
Expand Down
4 changes: 2 additions & 2 deletions allure-pytest/test/links/links_pattern_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
CUSTOM_LINK = 'pytest'


@pytest.allure.issue(ISSUE)
@pytest.allure.link(CUSTOM_LINK, link_type=CUSTOM_LINK_TYPE)
@allure.issue(ISSUE)
@allure.link(CUSTOM_LINK, link_type=CUSTOM_LINK_TYPE)
def test_link_pattern():
"""
>>> allure_report = getfixture('allure_report_with_params')('--allure-link-pattern=issue:{pattern}'.format(
Expand Down
7 changes: 4 additions & 3 deletions allure-pytest/test/status/base_step_status_test.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# -*- coding: utf-8 -*-
import pytest
import allure


def test_broken_step():
Expand All @@ -20,7 +21,7 @@ def test_broken_step():
... )
... )
"""
with pytest.allure.step('Step'):
with allure.step('Step'):
raise ZeroDivisionError


Expand All @@ -42,7 +43,7 @@ def test_pytest_fail_in_step():
... )
... )
"""
with pytest.allure.step('Step'):
with allure.step('Step'):
pytest.fail()


Expand All @@ -64,5 +65,5 @@ def test_pytest_bytes_data_in_assert():
... )
... )
"""
with pytest.allure.step('Step'):
with allure.step('Step'):
assert '0\x82' == 1
3 changes: 2 additions & 1 deletion allure-pytest/test/status/skip_step_status_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import pytest
import allure


def test_skip_in_step():
Expand All @@ -17,5 +18,5 @@ def test_skip_in_step():
... )
... )
"""
with pytest.allure.step('Step'):
with allure.step('Step'):
pytest.skip()
3 changes: 2 additions & 1 deletion allure-pytest/test/status/xfail_step_status_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import pytest
import allure


@pytest.mark.xfail()
Expand All @@ -20,5 +21,5 @@ def test_xfail_step_failure():
... )
... )
"""
with pytest.allure.step('Step'):
with allure.step('Step'):
assert False
4 changes: 2 additions & 2 deletions allure-pytest/test/steps/nested_steps_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@

@pytest.mark.parametrize("first_fail_before_second, first_fail_after_second, second_fail", fruit_machine)
def test_nested_steps_inside_test(first_fail_before_second, first_fail_after_second, second_fail):
with pytest.allure.step('First step'):
with allure.step('First step'):
assert not first_fail_before_second
with allure.step('Second step'):
assert not second_fail
Expand Down Expand Up @@ -91,7 +91,7 @@ def test_mixed_nested_steps(first_fail_before_second, first_fail_after_second, s

@pytest.mark.parametrize("first_fail_before_second, first_fail_after_second, second_fail", fruit_machine)
def test_again_mixed_nested_steps(first_fail_before_second, first_fail_after_second, second_fail):
with pytest.allure.step('First step'):
with allure.step('First step'):
assert not first_fail_before_second
second_step(second_fail)
assert not first_fail_after_second