support/testing: add pytest test

Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
This commit is contained in:
Marcin Niestroj
2020-09-01 19:16:45 +02:00
committed by Thomas Petazzoni
parent e53efebf85
commit fd89fcf944
3 changed files with 46 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
import pytest
x = 1
@pytest.fixture()
def f1():
global x
x = 2
yield 15
x = 3
def test_1():
assert x == 1
def test_2(f1):
assert x == 2
assert f1 == 15
def test_3():
assert x == 3