From ec2896d57d4c905e21c0ca4a49ff756d85485c99 Mon Sep 17 00:00:00 2001 From: Mateusz Bloch Date: Thu, 4 Apr 2024 10:21:18 +0200 Subject: [PATCH] sample: add pytest tests --- sample/test/test-pytest.py | 32 ++++++++++++++++++++++++++++++++ sample/test/test.yaml | 7 +++++++ 2 files changed, 39 insertions(+) create mode 100644 sample/test/test-pytest.py diff --git a/sample/test/test-pytest.py b/sample/test/test-pytest.py new file mode 100644 index 000000000..28b009be3 --- /dev/null +++ b/sample/test/test-pytest.py @@ -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 diff --git a/sample/test/test.yaml b/sample/test/test.yaml index 72a9e6fe8..0ef2c9eee 100644 --- a/sample/test/test.yaml +++ b/sample/test/test.yaml @@ -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]