pytest-dev / pytest-dev/pytest-forked

Allow marked tests to be skipped under Windows

Open
#44 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug enhancement help wanted
Dominant language
Python
Stars
83
Forks
29
PR merge metrics
No merged PRs in 30d

Description

Currently, if the test is marked with forked, this plugin tries to run it in a forked subprocess regardless of the current env. Also, adding a conditional skip marker does not help and manifests itself as https://github.com/pytest-dev/pytest/issues/7327.

The following snippet still runs on Windows:

@pytest.mark.skipif(IS_WINDOWS, ...)
@pytest.mark.forked
def test():
    ...

The workaround that I currently use is:

@pytest.mark.skipif(IS_WINDOWS, ...)
def test():
    ...

if not IS_WINDOWS:
    test = pytest.mark.forked(test)

This could be addressed in a few ways:

  1. Actually respect skip markers.
  2. Skip any tests marked with forked when the env is not supported.
  3. Run these tests but w/o trying to sandbox them.

I think I like 1+2 most.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the provided Windows example using the skipif and forked markers, and review the linked pytest issue 7327 for the marker interaction. Done should mean the selected behavior for unsupported Windows forked tests is implemented and verified against the reported snippet.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
operating-systems, testing
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.