AlexeySanko / pybuilder_pytest

Pytest plugin for PyBuilder: https://github.com/pybuilder/pybuilder
6 stars 3 forks source link

Add to README workaround for Integration tests #18

Open AlexeySanko opened 6 years ago

AlexeySanko commented 6 years ago

Any integration test could be usual PyTest file with specific main statement:

import inspect
import os
import sys

import pytest

from some_project import (
    some_function_for_testing
)

def test_some_function_for_testing():
    assert some_function_for_testing(1) == 'abc'

if __name__ == "__main__":
    ret = pytest.main([os.path.abspath((inspect.stack()[0])[1]), '-s', '-vv'])
    if ret:
        sys.exit(1)