gleb-sevruk / pycrunch-engine

NCrunch inspired tool for continuous testing Python
https://pycrunch.com
Other
57 stars 8 forks source link

Tests only run when I save the file #54

Closed jacobgawel closed 1 year ago

jacobgawel commented 2 years ago

PyCharm 2021.2.1 (Professional Edition) Build #PY-212.5080.64, built on August 25, 2021 Runtime version: 11.0.11+9-b1504.16 aarch64 macOS 11.5.2

Above is the version of PyCharm I am using.

Im using 'pycrunch-engine 1.2.2'

I have the settings set to running automatically but the tests only run when I save.

gleb-sevruk commented 2 years ago

That is expected behavior since pycrunch-engine process doesn't communicate with PyCharm IDE in order to get temporary modifications of the file.

The idea was to write an engine that can be used across multiple IDEs (VS Code, Sublime, IntelliJ). So, the current implementation listens for real changes on the file system and then re-runs affected tests.

This might change in the future but involves a lot of moving parts (for example creating a temporary workspace, cloning in-memory file modifications there via IntelliJ APIs, and then run pytest against temporary workspace)

ChucklesTheBeard commented 2 years ago

Hacky workaround in PyCharm: add a do-nothing "file watcher" to make the IDE save immediately, which then triggers PyCrunch.

gleb-sevruk commented 1 year ago

I am closing this as such behavior is expected.

Maybe in future I will think about in-memory snapshot and some an option for real-time processing / extracting text from unsaved Pycharm window.