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

10 statements  

« prev     ^ index     » next       coverage.py v6.5.0, created at 2022-11-29 20:01 +0000

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

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

3# 

4# This file is part of the tsfpga project, a project platform for modern FPGA development. 

5# https://tsfpga.com 

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

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

8 

9# Standard libraries 

10import sys 

11 

12# Third party libraries 

13import pytest 

14 

15# First party libraries 

16import tsfpga 

17 

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

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

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

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

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

23 

24 

25@pytest.fixture 

26def fixture_tmp_path(request, tmp_path): 

27 """ 

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

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

30 """ 

31 # Set class member tmp_path 

32 request.cls.tmp_path = tmp_path