Skip to content

Commit

Permalink
Move test_report_context into reporting.py module
Browse files Browse the repository at this point in the history
  • Loading branch information
youtux committed Jan 21, 2024
1 parent 566d066 commit 511fc17
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 16 deletions.
2 changes: 1 addition & 1 deletion src/pytest_bdd/cucumber_json.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import time
import typing

from pytest_bdd.registry import test_report_context
from .reporting import test_report_context

if typing.TYPE_CHECKING:
from typing import Any
Expand Down
2 changes: 1 addition & 1 deletion src/pytest_bdd/gherkin_terminal_reporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from _pytest.terminal import TerminalReporter

from pytest_bdd.registry import test_report_context
from .reporting import test_report_context

if typing.TYPE_CHECKING:
from typing import Any
Expand Down
11 changes: 0 additions & 11 deletions src/pytest_bdd/registry.py

This file was deleted.

5 changes: 3 additions & 2 deletions src/pytest_bdd/reporting.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
from typing import TYPE_CHECKING
from weakref import WeakKeyDictionary

from .registry import test_report_context

if TYPE_CHECKING:
from typing import Any, Callable

Expand Down Expand Up @@ -195,3 +193,6 @@ def after_step(
) -> None:
"""Finalize the step report as successful."""
scenario_reports_registry[request.node].current_step_report.finalize(failed=False)


test_report_context: WeakKeyDictionary[TestReport, ReportContext] = WeakKeyDictionary()
2 changes: 1 addition & 1 deletion tests/feature/test_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import pytest

from pytest_bdd.registry import test_report_context
from pytest_bdd.reporting import test_report_context


class OfType:
Expand Down

0 comments on commit 511fc17

Please sign in to comment.