Skip to content

RemovedInPytest4Warning with pytest 3.8.0 #300

Closed

Description

@James-Crean

I'm submitting a ...

  • bug report
  • feature request
  • support request => Please do not submit support request here, see note at the top of this template.

What is the current behavior?

Using allure-pytest with the latest version of pytest results in deprecation warnings.

Similar to: #291

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem

What is the expected behavior?

No deprecation warnings.

What is the motivation / use case for changing the behavior?

These warnings are numerous and should not be impeding testing/development.

Please tell us about your environment:

allure-pytest==2.5.2
allure-python-commons==2.5.2
pytest==3.8.2

Other information

Example warnings:

/lib/python2.7/site-packages/allure_pytest/utils.py:23: RemovedInPytest4Warning: MarkInfo objects are deprecated as they contain merged marks which are hard to deal with correctly.
Please use node.get_closest_marker(name) or node.iter_markers(name).
Docs: https://docs.pytest.org/en/latest/mark.html#updating-code
  return marker.args[0] if marker and marker.args else None
/lib/python2.7/site-packages/allure_pytest/utils.py:74: RemovedInPytest4Warning: MarkInfo objects are deprecated as they contain merged marks which are hard to deal with correctly.
Please use node.get_closest_marker(name) or node.iter_markers(name).
Docs: https://docs.pytest.org/en/latest/mark.html#updating-code
  args = [represent(arg) for arg in marker.args]
/lib/python2.7/site-packages/allure_pytest/utils.py:75: RemovedInPytest4Warning: MarkInfo objects are deprecated as they contain merged marks which are hard to deal with correctly.
Please use node.get_closest_marker(name) or node.iter_markers(name).
Docs: https://docs.pytest.org/en/latest/mark.html#updating-code
  kwargs = ['{name}={value}'.format(name=key, value=represent(marker.kwargs[key])) for key in marker.kwargs]
/lib/python2.7/site-packages/allure_pytest/utils.py:80: RemovedInPytest4Warning: MarkInfo objects are deprecated as they contain merged marks which are hard to deal with correctly.
Please use node.get_closest_marker(name) or node.iter_markers(name).
Docs: https://docs.pytest.org/en/latest/mark.html#updating-code
  return '@pytest.mark.{name}'.format(name=marker.name)

Activity

  1. dstoianov commented on Oct 23, 2018

    @dstoianov

    same error

  2. sseliverstov commented on Oct 29, 2018

    @sseliverstov
    Contributor

    fixed in 2.5.3

  3. deepjia commented on Oct 31, 2018

    @deepjia

    Still got two warnings with allure-pytest-2.5.3 & pytest-3.8.2/pytest-3.9.3:

    ……/test/venv/lib/python3.7/site-packages/allure_pytest/utils.py:46: RemovedInPytest4Warning: MarkInfo objects are deprecated as they contain merged marks which are hard to deal with correctly.
    Please use node.get_closest_marker(name) or node.iter_markers(name).
    Docs: https://docs.pytest.org/en/latest/mark.html#updating-code
      label_type = marker.kwargs['label_type']
    
    ……/test/venv/lib/python3.7/site-packages/allure_pytest/utils.py:48: RemovedInPytest4Warning: MarkInfo objects are deprecated as they contain merged marks which are hard to deal with correctly.
    Please use node.get_closest_marker(name) or node.iter_markers(name).
    Docs: https://docs.pytest.org/en/latest/mark.html#updating-code
      yield (label_type, marker.args[0])
    
  4. tsbxmw commented on Nov 13, 2018

    @tsbxmw
    Contributor
  5. added a commit that references this issue on Nov 13, 2018
  6. added a commit that references this issue on Nov 18, 2020
    33c1729
  7. added a commit that references this issue on Apr 10, 2023
    7e4728e
  8. added 2 commits that reference this issue on Mar 19, 2024
    8bea210
    df6876e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions