#!/usr/bin/env python
# Don't run tests from the root repo dir.
# We want to ensure we're importing from the installed
# binary package not from the CWD.

import os
import sys

import pytest

_dname = os.path.dirname

REPO_ROOT = _dname(_dname(_dname(os.path.abspath(__file__))))
os.chdir(os.path.join(REPO_ROOT, 'tests'))


def main():
    args = ['-v', 'integration/']
    print(f'Running py.test with args: {args}')
    return pytest.main(args)


if __name__ == '__main__':
    sys.exit(main())
