Skip to content

Commit 52da0eb

Browse files
fix test
1 parent 97b76b6 commit 52da0eb

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

tests/testing/internal/pytest/test_pytest_bdd.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,17 @@
22

33
import json
44
import os
5+
from unittest.mock import Mock
56
from unittest.mock import patch
67

78
from _pytest.pytester import Pytester
89
import pytest
910

1011
from ddtrace.constants import ERROR_MSG
1112
from ddtrace.ext import test
13+
from ddtrace.testing.internal.pytest.bdd import BddTestOptPlugin
1214
from ddtrace.testing.internal.pytest.bdd import _get_step_func_args_json
15+
from tests.contrib.patch import emit_integration_and_version_to_test_agent
1316
from tests.testing.mocks import EventCapture
1417
from tests.testing.mocks import mock_api_client_settings
1518
from tests.testing.mocks import setup_standard_mocks
@@ -25,11 +28,12 @@
2528

2629

2730
class TestPytestBdd:
28-
# def test_and_emit_get_version(self, pytester: Pytester) -> None:
29-
# version = get_version()
30-
# assert isinstance(version, str)
31-
# assert version != ""
32-
# emit_integration_and_version_to_test_agent("pytest-bdd", version)
31+
def test_and_emit_get_version(self) -> None:
32+
plugin = BddTestOptPlugin(Mock())
33+
version = plugin._get_framework_version()
34+
assert isinstance(version, str)
35+
assert version != ""
36+
emit_integration_and_version_to_test_agent("pytest-bdd", version)
3337

3438
def test_pytest_bdd_scenario_with_parameters(self, pytester: Pytester) -> None:
3539
"""Test that pytest-bdd traces scenario with all steps."""

0 commit comments

Comments
 (0)