-
Notifications
You must be signed in to change notification settings - Fork 233
Closed
Labels
Description
Step 1: Provide a summary of your problem
When trying to package 1.7.0 for Arch Linux I ran pytest against the build. Unfortunately the current setup with poetry makes this fairly hard, as the test plugins are included in the pyproject.toml, of which pytest is unaware.
This can only be circumvented by adding the fairly long paths of all plugins to PYTHONPATH
before calling pytest:
PYTHONPATH="build:tests/fixtures/pluginsystem/plugins/tmuxp_test_plugin_awf" \
PYTHONPATH+=':tests/fixtures/pluginsystem/plugins/tmuxp_test_plugin_bs' \
PYTHONPATH+=':tests/fixtures/pluginsystem/plugins/tmuxp_test_plugin_bwb' \
PYTHONPATH+=':tests/fixtures/pluginsystem/plugins/tmuxp_test_plugin_fail' \
PYTHONPATH+=':tests/fixtures/pluginsystem/plugins/tmuxp_test_plugin_owc' \
PYTHONPATH+=":tests/fixtures/pluginsystem/plugins/tmuxp_test_plugin_r:$PYTHONPATH"
export PYTHONPATH
The above is cumbersome and error-prone, as new plugins are potentially added to the test scenario.
Step 2: Provide tmuxp details
$ pytest -v -k "not test_pane_order"
============================= test session starts ==============================
platform linux -- Python 3.9.1, pytest-6.2.1, py-1.10.0, pluggy-0.13.1 -- /usr/bin/python
cachedir: .pytest_cache
rootdir: /build/tmuxp/src/tmuxp-1.7.0, configfile: setup.cfg
plugins: rerunfailures-9.1.1
collecting ... collected 78 items / 1 error / 1 deselected / 76 selected
==================================== ERRORS ====================================
______________________ ERROR collecting tests/test_cli.py ______________________
ImportError while importing test module '/build/tmuxp/src/tmuxp-1.7.0/tests/test_cli.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib/python3.9/importlib/__init__.py:127: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
tests/test_cli.py:18: in <module>
from tmuxp_test_plugin_bwb.plugin import PluginBeforeWorkspaceBuilder
E ModuleNotFoundError: No module named 'tmuxp_test_plugin_bwb'
=========================== short test summary info ============================
ERROR tests/test_cli.py
!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!
======================== 1 deselected, 1 error in 0.32s ========================
- Include output of
tmuxp debug-info
- Include any other pertinant system info not captured
Step 3: Describe the problem:
Steps to reproduce:
- python setup.py build
- pytest -v
Observed Results:
The pytest call is unaware of the test plugins and fails.
Expected Results:
After build pytest can be run in a normal environment.
Relevant Code:
n/a