Coverage for tsfpga/test/conftest.py: 100%

10 statements  

« prev     ^ index     » next       coverage.py v6.4, created at 2022-05-28 04:01 +0000

1# -------------------------------------------------------------------------------------------------- 

2# Copyright (c) Lukas Vik. All rights reserved. 

3# 

4# This file is part of the tsfpga project. 

5# https://tsfpga.com 

6# https://gitlab.com/tsfpga/tsfpga 

7# -------------------------------------------------------------------------------------------------- 

8 

9import sys 

10import pytest 

11 

12import tsfpga 

13 

14# Do PYTHONPATH insert() instead of append() to prefer any local repo checkout over any pip install 

15PATH_TO_HDL_REGISTERS = tsfpga.REPO_ROOT.parent.resolve() / "hdl_registers" 

16sys.path.insert(0, str(PATH_TO_HDL_REGISTERS)) 

17PATH_TO_VUNIT = tsfpga.REPO_ROOT.parent.parent.resolve() / "vunit" / "vunit" 

18sys.path.insert(0, str(PATH_TO_VUNIT)) 

19 

20 

21@pytest.fixture 

22def fixture_tmp_path(request, tmp_path): 

23 """ 

24 A pytest fixture for usage in unittest.TestCase style test classes which gives 

25 access to a unique temp path for each test case. 

26 """ 

27 # Set class member tmp_path 

28 request.cls.tmp_path = tmp_path