mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
24 lines
651 B
Plaintext
24 lines
651 B
Plaintext
import pytest
|
|
|
|
|
|
@pytest.mark.parametrize("test_input,expected", [
|
|
("3+5", 8),
|
|
("2+4", 6),
|
|
])
|
|
@pytest.mark.parametrize("x", [0, 1])
|
|
@pytest.mark.parametrize("y", [2, 3])
|
|
def test_returns_correct_result(test_input, expected, x, y): # False positive: unused parameters
|
|
y.bit_length() #
|
|
x.bit_length() #
|
|
test_input.__len__() #
|
|
expected.bit_length() #
|
|
|
|
@pytest.mark.parametrize(('x', 'y'), [(1, 2, 3, 4)]) # Too many values in tuple, should be 2
|
|
def test_wrong_number_of_parameters(x, y):
|
|
x.bit_length() #
|
|
|
|
@pytest.mark.parametrize("y", ['2', 3])
|
|
def test_foo(y):
|
|
y.bit_length() #
|
|
y.__xor__( )#
|
|
y.upper()# |