Skip to content

Commit

Permalink
sample: add pytest tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mateusz-bloch committed Sep 27, 2024
1 parent 156ab79 commit ec2896d
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
32 changes: 32 additions & 0 deletions sample/test/test-pytest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import pytest


def test_always_passes():
assert True


@pytest.mark.skip(reason="CI CHECK")
def test_always_fails(ctx):
assert False, "Always Fail"


@pytest.mark.skip(reason="Test")
def test_always_skip():
assert True


def test_always_xfail():
pytest.xfail("xfail")


@pytest.mark.xfail(reason="always xfail")
def test_always_xpass():
pass


def test_ctx(ctx):
assert ctx is not None


def test_dut(dut):
assert dut is not None
7 changes: 7 additions & 0 deletions sample/test/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,10 @@ test:
type: unity
targets:
include: [host-generic-pc]

- name: pytest
type: pytest
kwargs:
path: phoenix-rtos-tests/sample/test/test-pytest.py
targets:
include: [host-generic-pc]

0 comments on commit ec2896d

Please sign in to comment.