Skip to content

pytest-pystack raises exception when using with pytester fixture #10

@Czaki

Description

@Czaki

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.

Process pystack_monitor:
Traceback (most recent call last):
  File "/home/czaki/.pyenv/versions/3.11.5/lib/python3.11/multiprocessing/process.py", line 314, in _bootstrap
    self.run()
  File "/home/czaki/.pyenv/versions/3.11.5/lib/python3.11/multiprocessing/process.py", line 108, in run
    self._target(*self._args, **self._kwargs)
  File "/home/czaki/.pyenv/versions/napari_3.11/lib/python3.11/site-packages/pytest_pystack/_monitor_process.py", line 57, in _run_monitor
    raise Exception(
Exception: new test should not start before previous test finished

This stacktrace comes from https://github.com/napari/napari/blob/cb7f46dfe0100c3afdd622faca768bc393b19636/napari/_tests/test_pytest_plugin.py

To Reproduce
Steps to reproduce the behavior:

  1. Create a test that uses pytester fixture to run tests
  2. Run it in environment with pytest-pystack

Expected behavior

Allow use pytester with pytest-pystack

Screenshots
If applicable, add screenshots to help explain your problem.

Environment (please complete the following information):

  • Operating System and Version: GitHub actions all systems

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