def test_extract_bytes_invalid(): """Ensure that invalid input causes exception to be raised.""" with pytest.raises( ValueError, match=r'^extract_bytes\(\) only accepts bytes ' 'and memoryview/buffer$', ): extract_bytes(u'some юнікод їїї')
def test_extract_bytes_invalid(): """Ensure that invalid input causes exception to be raised.""" with pytest.raises(ValueError): extract_bytes(u'some юнікод їїї')
def test_extract_bytes(input_argument, expected_result): """Check that legitimate inputs produce bytes.""" assert extract_bytes(input_argument) == expected_result
def test_extract_bytes_invalid(): """Ensure that invalid input causes exception to be raised.""" with pytest.raises(ValueError): extract_bytes(u'some юнікод їїї')
def test_extract_bytes(input_argument, expected_result): """Check that legitimate inputs produce bytes.""" assert extract_bytes(input_argument) == expected_result