Skip to content

Instantly share code, notes, and snippets.

@seanaye
Last active February 12, 2021 01:36
Show Gist options
  • Save seanaye/119c3b8d98c8884bcab639fa37e6734f to your computer and use it in GitHub Desktop.
Save seanaye/119c3b8d98c8884bcab639fa37e6734f to your computer and use it in GitHub Desktop.
Pytest example
import pytest
import file
@pytest.fixture
def res_2_3():
return file.reserve_2d_array(2, 3)
@pytest,fixture
def res_0_0():
return file.reserve_2d_array(0,0)
def test_reserve_2d_array(res_2_3):
assert type(res_2_3) is List
def test_rewefwdf_2(res_2_3):
for i in res_2_3:
assert type(i) is List
def test_sfvsdvsd(res_2_3):
for i in res_2_3:
for j in i:
assert type(j) is Byte
assert j == 0x00
def test_fefwe(res_0_0):
assert len(res_0_0) == 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment