core: add tests for core_config

This commit is contained in:
Dima Gerasimov 2020-09-29 11:01:51 +01:00 committed by karlicoss
parent 70c801f692
commit c79ffb50f6
4 changed files with 69 additions and 25 deletions

14
tests/core.py Normal file
View file

@ -0,0 +1,14 @@
'''
NOTE: Sigh. it's nice to be able to define the tests next to the source code (so it serves as documentation).
However, if you run 'pytest --pyargs my.core', it detects 'core' package name (because there is no my/__init__.py)
(see https://docs.pytest.org/en/latest/goodpractices.html#tests-as-part-of-application-code)
This results in relative imports failing (e.g. from ..kython import...).
By using this helper file, pytest can detect the package name properly. A bit meh, but perhaps after kython is moved into the core,
we can run against the tests in my.core directly.
'''
from my.core.core_config import *
from my.core.error import *

View file

@ -46,10 +46,6 @@ def prepare(tmp_path: Path):
pass
# meh. otherwise was struggling to run directly against my.core.error...
from my.core.error import *
from typing import Iterable, List
import warnings
from my.core import warn_if_empty