Skip to content
Snippets Groups Projects
Select Git revision
  • d474f87a8c7ef083ef8e82295a9747cbccc4f407
  • master default protected
  • rangersbach/c-interfacing
  • fhennig/devel
  • v0.1a4
  • v0.1a3
  • v0.1a2
  • v0.1a1
8 results

conftest.py

Blame
  • Frederik Hennig's avatar
    Frederik Hennig authored and Christoph Alt committed
    962f8c67
    History
    conftest.py 745 B
    import pytest
    from os import path
    
    
    DATA_DIR = path.join(path.split(__file__)[0], "tests/data")
    
    
    @pytest.fixture
    def sample_config_module():
        return path.join(DATA_DIR, "project_config.py")
    
    
    @pytest.fixture
    def sfg():
        from pystencilssfg import SfgContext, SfgComposer
        from pystencilssfg.ir import SfgSourceFile, SfgSourceFileType
    
        return SfgComposer(
            SfgContext(
                header_file=SfgSourceFile("", SfgSourceFileType.HEADER),
                impl_file=SfgSourceFile("", SfgSourceFileType.TRANSLATION_UNIT),
            )
        )
    
    
    @pytest.fixture(autouse=True)
    def prepare_doctest_namespace(doctest_namespace, sfg):
        from pystencilssfg import lang
    
        doctest_namespace["sfg"] = sfg
        doctest_namespace["lang"] = lang