~amirouche/mutation

53cf8dc695fb28c3c5040377b00e1dcf6fe5de17 — Amirouche 3 months ago 33d6b69
add example of false-positive error.
2 files changed, 13 insertions(+), 5 deletions(-)

M foobar/ex.py
M test.py
M foobar/ex.py => foobar/ex.py +4 -1
@@ 1,2 1,5 @@
def decrement(a):
"""docstring for testing false-positive mutation (module)"""

def decrement_by_two(a):
    """docstring for testing false-positive mutation (function)"""
    return a - 2

M test.py => test.py +9 -4
@@ 1,7 1,12 @@
import sys
from foobar.ex import decrement
from foobar.ex import decrement_by_two


def test_foobar():
    x = decrement(10)
    assert 7 < x < 9
def test_one():
    x = decrement_by_two(10)
    assert x < 10


def test_two():
    x = decrement_by_two(44)
    assert x < 44