Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixture in pytest 8.1.0 #12063

Closed
zheldashev opened this issue Mar 4, 2024 · 1 comment
Closed

Fixture in pytest 8.1.0 #12063

zheldashev opened this issue Mar 4, 2024 · 1 comment

Comments

@zheldashev
Copy link

zheldashev commented Mar 4, 2024

Use Fixture in my tests. With version pytest 8.1.0 (2024-03-03) have problems when call them:

self = <allure_pytest.listener.AllureListener object at 0x7f3cc910a750>
item = <Function test_moscow_kladr>
    @pytest.hookimpl(hookwrapper=True)
    def pytest_runtest_setup(self, item):
        if not self._cache.get(item.nodeid):
            uuid = self._cache.push(item.nodeid)
            test_result = TestResult(name=item.name, uuid=uuid, start=now(), stop=now())
            self.allure_logger.schedule_test(uuid, test_result)
        yield
>       self._update_fixtures_children(item)
/usr/local/lib/python3.11/site-packages/allure_pytest/listener.py:102: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/local/lib/python3.11/site-packages/allure_pytest/listener.py:71: in _update_fixtures_children
    for fixturedef in _test_fixtures(item):
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
item = <Function test_moscow_kladr>
    def _test_fixtures(item):
        fixturemanager = item.session._fixturemanager
        fixturedefs = []
    
        if hasattr(item, "_request") and hasattr(item._request, "fixturenames"):
            for name in item._request.fixturenames:
>               fixturedefs_pytest = fixturemanager.getfixturedefs(name, item.nodeid)
E               AttributeError: 'str' object has no attribute 'iter_parents'
/usr/local/lib/python3.11/site-packages/allure_pytest/listener.py:345: AttributeError
@zheldashev zheldashev changed the title Fixture in Fixture in pytest 8.1.0 Mar 4, 2024
@bluetech
Copy link
Member

bluetech commented Mar 4, 2024

The allure_pytest uses some internal pytest functions which changed in pytest 8.1.0, unfortunately the allure_pytest plugin will need to make some adjustments for pytest 8.1 compatibility. Please report the issue to allure-pytest.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants