HPI/my/core/tests/test_cli.py
Dima Gerasimov 9594caa1cd general: move most core tests inside my.core.tests package
- distributes tests alongside the package, might be convenient for package users
- removes some weird indirection (e.g. dummy test files improting tests from modules)
- makes the command line for tests cleaner (e.g. no need to remember to manually add files to tox.ini)
- tests automatically covered by mypy (so makes mypy runs cleaner and ultimately better coverage)

The (vague) convention is

- tests/somemodule.py -- testing my.core.somemodule, contains tests directly re
- tests/test_something.py -- testing a specific feature, e.g. test_get_files.py tests get_files methon only
2023-05-25 00:25:13 +01:00

16 lines
549 B
Python

import os
from subprocess import check_call
import sys
def test_lists_modules() -> None:
# hack PYTHONUTF8 for windows
# see https://github.com/karlicoss/promnesia/issues/274
# https://memex.zulipchat.com/#narrow/stream/279600-promnesia/topic/indexing.3A.20utf8.28emoji.29.20filenames.20in.20Windows
# necessary for this test cause emooji is causing trouble
# TODO need to fix it properly
env = {
**os.environ,
'PYTHONUTF8': '1',
}
check_call([sys.executable, '-m', 'my.core', 'modules'], env=env)