Skip to content

Commit

Permalink
added coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
joesavage-silabs committed Mar 8, 2024
1 parent aeb87f4 commit 5cb1fb3
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 2 deletions.
21 changes: 21 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import otel_extensions_pytest
import pytest


def pytest_addoption(parser):
otel_extensions_pytest.pytest_addoption(parser)


def pytest_configure(config):
otel_extensions_pytest.pytest_configure(config)
otel_extensions_pytest.pytest_configure(config)
otel_extensions_pytest.init_telemetry(config)


def pytest_sessionfinish(session, exitstatus):
otel_extensions_pytest.pytest_sessionfinish(session, exitstatus)


@pytest.hookimpl(trylast=True)
def pytest_unconfigure(config):
otel_extensions_pytest.pytest_unconfigure(config)
2 changes: 1 addition & 1 deletion tests/test_decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ def dummy_fixture():

@instrumented_fixture
def dummy_fixture_2():
return 24
yield 24


def test_dummy_fixtures(dummy_fixture, dummy_fixture_2):
Expand Down
3 changes: 2 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ deps=-r{toxinidir}/requirements.txt
commands=
python -m pytest {tty:--color=yes} \
--cov=otel_extensions_pytest --cov-branch \
--junitxml {toxworkdir}{/}junit-{envname}.xml \
--cov-report=xml --cov-report=term \
--junitxml {toxworkdir}{/}junit-{envname}.xml \
tests --cov-fail-under=80
mypy otel_extensions_pytest

Expand Down

0 comments on commit 5cb1fb3

Please sign in to comment.