scripts: tests: twister: Mixin test

Simple test checking whether our method for skipping unwanted
test classes works.

Signed-off-by: Lukasz Mrugala <lukaszx.mrugala@intel.com>
This commit is contained in:
Lukasz Mrugala 2023-09-05 13:28:51 +02:00 committed by Anas Nashif
parent 990b421b09
commit 0af7770132
2 changed files with 23 additions and 0 deletions

View file

@ -0,0 +1,5 @@
from twisterlib.mixins import DisablePyTestCollectionMixin
class TestClassToIgnore(DisablePyTestCollectionMixin):
def test_to_ignore(self):
assert False

View file

@ -0,0 +1,18 @@
#!/usr/bin/env python3
# Copyright (c) 2023 Intel Corporation
#
# SPDX-License-Identifier: Apache-2.0
"""
Tests for the mixins class
"""
import os
import pytest
def test_disable_pytest_test_collection(test_data):
test_path = os.path.join(test_data, 'mixins')
return_code = pytest.main([test_path])
assert return_code == 5