Skip to content

Commit

Permalink
fix: repair no_skipped_tests (#196)
Browse files Browse the repository at this point in the history
  • Loading branch information
morgante authored Apr 16, 2024
1 parent 4dfa817 commit 37e115f
Showing 1 changed file with 37 additions and 3 deletions.
40 changes: 37 additions & 3 deletions .grit/patterns/python/no_skipped_tests.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@ engine marzano(0.1)
language python
decorated_definition($decorators, $definition) where {
$decorators <: includes `@pytest.mark.skip`,
$decorators <: not includes `reason`
} => $definition
$decorators <: contains `@pytest.mark.skip($info)` => . where {
$info <: not includes `reason`
}
}
```

## Forbidden
Expand All @@ -39,3 +40,36 @@ If you include a reason explaining why the test is skipped, it will be allowed.
def test_the_unknown():
pass
```

## Other decorators

Any other decorators are still preserved.

```py
@pytest.mark.skip()
@pytest.mark.xfail(reason="This test is expected to fail")
def test_the_unknown():
pass
```

```py
@pytest.mark.xfail(reason="This test is expected to fail")
def test_the_unknown():
pass
```


## Ordering doesn't matter

```py
@pytest.mark.xfail(reason="This test is expected to fail")
@pytest.mark.skip()
def test_the_unknown():
pass
```

```py
@pytest.mark.xfail(reason="This test is expected to fail")
def test_the_unknown():
pass
```

0 comments on commit 37e115f

Please sign in to comment.