PytestSetting Project Test System

From NovaOrdis Knowledge Base
Revision as of 01:09, 9 June 2022 by Ovidiu (talk | contribs)
Jump to navigation Jump to search

Internal

Layout

...
 └─ test
     └─ python
         └─ my_module
             ├─ data
             └─ test_my_function.py

Structure of a Test File

import pytest

from my_module_to_test import some_function

def get_data_file(file_name):
    return Path(Path(__file__).parent, f'./data/{file_name}')