Clase para agrupar las pruebas del filtrado del marco de datos

parent 3625bdb5
......@@ -32,7 +32,17 @@ def red_prueba():
return red
@pytest.mark.parametrize("ultima", [1, 2, 3, 4])
def test_filtrado_correcto(df_prueba, ultima):
df_filtrado = main.filtrar_primeras_posiciones(df_prueba, ultima_posicion=ultima)
assert df_filtrado['posicion'].max() <= ultima
class TestFiltrado:
@pytest.mark.parametrize("ultima", [1, 2, 3, 4])
def test_filtrado_correcto(self, df_prueba, ultima):
df_filtrado = main.filtrar_primeras_posiciones(df_prueba, ultima_posicion=ultima)
assert df_filtrado['posicion'].max() <= ultima
@pytest.mark.parametrize('df_falso', ['df_prueba', 5, 5.0, True])
def test_sin_df(self, df_falso):
with pytest.raises(TypeError):
main.filtrar_primeras_posiciones(df_falso)
def test_sin_columna_posicion(self, df_prueba):
with pytest.raises(ValueError):
main.filtrar_primeras_posiciones(df_prueba.drop('posicion', axis=1))
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment