-
Notifications
You must be signed in to change notification settings - Fork 3
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
pytest-pystack raises exception when using with pytester fixture #10
Comments
Will take a look at this soon |
Hummm, I cannot reproduce this. I am checking with this test file:
And running
|
Your example does not contain a test in the created file. Try this one: import pytest
import time
pytest_plugins = 'pytester'
def test_make_napari_viewer(pytester):
"""Make sure that our make_napari_viewer plugin works."""
# create a temporary pytest test file
pytester.makepyfile(
"""
import time
def test_sleep():
time.sleep(1)
assert 1 == 2
"""
)
# run all tests with pytest
result = pytester.runpytest()
# check that all 1 test passed
result.assert_outcomes(passed=1) |
@pablogsal Any update? |
I could reproduce with this example but with Python 3.13 beta 1 soon I cannot prioritise this currently as I need to attend other projects. Maybe @gusmonod can take a look Otherwise if you want to give it a go we can take a PR :) |
Oh, actually I haven't realised you opened a PR here: Can you add a test for this and we can merge it? |
Added test |
Describe the bug
Pytest provides
pytester
fixture to allow to validate if fixtures provided by a package works correctly:https://docs.pytest.org/en/7.1.x/reference/reference.html?highlight=pytester#pytester
However, this leads to run test in test and leads
pytest-pystack
to crash.This stacktrace comes from https://github.com/napari/napari/blob/cb7f46dfe0100c3afdd622faca768bc393b19636/napari/_tests/test_pytest_plugin.py
To Reproduce
Steps to reproduce the behavior:
pytester
fixture to run testsExpected behavior
Allow use
pytester
withpytest-pystack
Screenshots
If applicable, add screenshots to help explain your problem.
Environment (please complete the following information):
The text was updated successfully, but these errors were encountered: