#!/usr/bin/python3

import pytest
import sys
import os

if __name__ == "__main__":
    # Need to run pytest in the top level directory, which we identify by the presence of pyproject.toml
    cwd = os.getcwd()
    while not os.path.exists(os.path.join(cwd,'pyproject.toml')):
        cwd = os.path.dirname(cwd)
        os.chdir(cwd)
    # Need to be able to find pylibxc
    sys.path.append(cwd)
    # Now run pytest
    sys.exit(pytest.main())
