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 Aug 13, 2024
1 parent 828404b commit 8e740df
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
30 changes: 30 additions & 0 deletions sample/test/test-pytest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
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):

Check failure on line 26 in sample/test/test-pytest.py

View workflow job for this annotation

GitHub Actions / build (3.9)

E302 expected 2 blank lines, found 1

Check failure on line 26 in sample/test/test-pytest.py

View workflow job for this annotation

GitHub Actions / build (3.10)

E302 expected 2 blank lines, found 1
assert ctx is not None

def test_dut(dut):

Check failure on line 29 in sample/test/test-pytest.py

View workflow job for this annotation

GitHub Actions / build (3.9)

E302 expected 2 blank lines, found 1

Check failure on line 29 in sample/test/test-pytest.py

View workflow job for this annotation

GitHub Actions / build (3.10)

E302 expected 2 blank lines, found 1
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 8e740df

Please sign in to comment.