Skip to content

4.0.0

Compare
Choose a tag to compare
@github-actions github-actions released this 27 Feb 03:50
· 86 commits to master since this release
0b1e8fa

changes

  • collection will now always run during the pytest_collection stage. this probably significantly improves compatibility with other pytest plugins (#218)
  • the deprecated listener and pre_rebot_modifier decorators have been removed (#218)

Full Changelog: 3.2.1...4.0.0

⚠️ breaking changes / migration guide

the deprecated listener and pre_rebot_modifier decorators have been removed.

listeners

before

# conftest.py
@listener
def Foo(ListenerV3):
    ...

after

# conftest.py
from pytest_robotframework import RobotOptions

def Foo(ListenerV3):
    ...

def pytest_robot_modify_options(options: RobotOptions):
    options["listener"].append(Foo())

pre-run modifiers

before

# conftest.py
@pre_run_modifier
def Foo(SuiteVisitor):
    ...

after

# conftest.py
from pytest_robotframework import RobotOptions

def Foo(SuiteVisitor):
    ...

def pytest_robot_modify_options(options: RobotOptions):
    options["prerunmodifier"].append(Foo())

why?

using the pytest_robot_modify_options may be more boilerplatey, but there are several benefits to this approach:

  • it gives you far more control over when listeners/pre-run modifiers are enabled, and allows you to instantiate them yourself with different arguments
  • it does not rely on global state to "register" them to be enabled when robotframework runs, which was flaky when running with xdist