Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

fixtures do not record dependencies on other fixtures

Abierto
#929 0 comentarios 1 reacción 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
64/100
Tipo de issue
Nueva funcionalidad
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
python
Área
testing

Línea de trabajo

Start in the allure-pytest listener's pytest_fixture_setup handling, where each fixture becomes a before entry in a container JSON file; the fixturedef handed to that hook exposes the fixture's argument names, which is exactly the dependency data missing from the output. Run the snippet from the issue to generate the allure/*.json files and confirm where the ordering information is lost. Check whether the shared Allure results schema needs a new field before a report can order the fixtures, then verify existing allure-pytest tests still pass.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

theme:pytest

Example:

import pytest
import allure


def func(n):
    return n**2


@pytest.fixture()
def input_data():
    with allure.step("Prepare input data"):
        data = 5

    return data


@pytest.fixture()
def compute_job(input_data):

    with allure.step("Compute result"):
        result = func(input_data)

    return result


def test(compute_job):

    with allure.step("Verify result"):
        assert compute_job == 25

In this case, allure output json files contain no information that allows to deduce that the compute_job fixture depends on the input_data fixture.

Since they are fast, time ordering is not possible in most cases, since times are only recorded as integer seconds.

The allure report then shows the two fixtures in the wrong order:

Image
Output json files:

allure/404698a7-6d47-46ee-951e-f1370a8ae247-container.json

{
  "uuid": "a00b000b-e3bf-4599-b1fe-f99a4d9265fb",
  "children": [
    "cb8afcb4-86c9-4ec5-b7c1-def3c168afde"
  ],
  "befores": [
    {
      "name": "compute_job",
      "status": "passed",
      "steps": [
        {
          "name": "Compute result",
          "status": "passed",
          "start": 1791292365354,
          "stop": 1791292365354
        }
      ],
      "start": 1791292365354,
      "stop": 1791292365354
    }
  ],
  "afters": [
    {
      "name": "compute_job::<lambda>",
      "start": 1791292365355
    }
  ],
  "start": 1791292365354,
  "stop": 1791292365355
}

allure/b068721b-3ae1-4959-9376-e840e763dbee-container.json

{
  "uuid": "76f7b786-56ff-4b9b-9931-98c632f44c92",
  "children": [
    "cb8afcb4-86c9-4ec5-b7c1-def3c168afde"
  ],
  "befores": [
    {
      "name": "input_data",
      "status": "passed",
      "steps": [
        {
          "name": "Prepare input data",
          "status": "passed",
          "start": 1791292365354,
          "stop": 1791292365354
        }
      ],
      "start": 1791292365354,
      "stop": 1791292365354
    }
  ],
  "afters": [
    {
      "name": "input_data::<lambda>",
      "start": 1791292365355
    }
  ],
  "start": 1791292365354,
  "stop": 1791292365355
}

allure/a16a30e1-80d0-4a0e-8dda-54c1cbbb5157-result.json

{
  "name": "test",
  "status": "passed",
  "steps": [
    {
      "name": "Verify result",
      "status": "passed",
      "start": 1791292365355,
      "stop": 1791292365355
    }
  ],
  "start": 1791292365355,
  "stop": 1791292365355,
  "uuid": "cb8afcb4-86c9-4ec5-b7c1-def3c168afde",
  "historyId": "761acda85279d873545739563f5f4cb2",
  "testCaseId": "761acda85279d873545739563f5f4cb2",
  "fullName": "test_example#test",
  "labels": [
    {
      "name": "suite",
      "value": "test_example"
    },
    {
      "name": "host",
      "value": "max-desktop"
    },
    {
      "name": "thread",
      "value": "980504-MainThread"
    },
    {
      "name": "framework",
      "value": "pytest"
    },
    {
      "name": "language",
      "value": "cpython3"
    },
    {
      "name": "package",
      "value": "test_example"
    }
  ],
  "titlePath": [
    "test_example.py"
  ]
}
Lenguaje dominante
Python
Estrellas
819
Forks
261
Merge medio
3 h 20 min
PR fusionados (30 d)
3

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de allure-framework/allure-python

Todos los issues de allure-framework/allure-python

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.