pytest: how to make dedicated test directory
问题 I want the following project structure: |--folder/ | |--tests/ | |--project/ Let's write a simple example: |--test_pytest/ | |--tests/ | | |--test_sum.py | |--t_pytest/ | | |--sum.py | | |--__init__.py sum.py: def my_sum(a, b): return a + b test_sum.py: from t_pytest.sum import my_sum def test_my_sum(): assert my_sum(2, 2) == 5, "math still works" Let's run it: test_pytest$ py.test ./ ========== test session starts =========== platform linux -- Python 3.4.3, pytest-2.9.2, py-1.4.31, pluggy-0