- 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
16 lines
549 B
Python
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)
|