Skip to content

Hooks not recognized when freezing with cx_Freeze #159

@The-Compiler

Description

@The-Compiler

This might be a pytest core issue as well, but I'm not sure - all my other plugins work fine, and I can't imagine pytest-bdd is the only one with custom hooks.

When running the tests frozen with cx_Freeze, after working around #158, I get:

____________________________________________ test_going_backforward ____________________________________________

request = <FixtureRequest for <Function 'test_going_backforward'>>

>   ???

tests/integration/features/test_features.py:41: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

feature = <pytest_bdd.feature.Feature object at 0x7f40b4716da0>
scenario = <pytest_bdd.feature.Scenario object at 0x7f40b4716e80>
request = <FixtureRequest for <Function 'test_going_backforward'>>, encoding = 'utf-8'

    def _execute_scenario(feature, scenario, request, encoding):
        """Execute the scenario.

        :param feature: Feature.
        :param scenario: Scenario.
        :param request: request.
        :param encoding: Encoding.
        """
>       request.config.hook.pytest_bdd_before_scenario(
            request=request,
            feature=feature,
            scenario=scenario,
        )
E       AttributeError: 'HookRelay' object has no attribute 'pytest_bdd_before_scenario'

.tox/unittests-frozen/lib/python3.4/site-packages/pytest_bdd/scenario.py:148: AttributeError

After commenting out all the hook calls, it works fine... I also tried the branch from #149 but that didn't help.

Any idea why this is happening?

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