我正在使用GNU Emacs 24.5.1处理Python代码。我通常只想运行一个单元测试。我可以这样做,例如,通过运行:
test=spi.test_views.IndexViewTest.generate_select2_data_with_embedded_spaces make test
使用M-X编译。如果我能给出一些命令,比如“在点所在的位置运行测试”,并让emacs为我计算出测试的全名,我的生活会更简单。有可能吗
更新:使用以下缓冲区,我想要一些运行M-X compile的命令:
test=spi.test_views.IndexViewTest.test_unknown_button make test
其中spi是test_views.py所在目录的名称。从技术上讲,我需要构造测试函数的python路径,但在实践中,它将是<;directory.file.class.function>
这似乎是有人已经发明的东西,但我在python模式文档中没有看到任何东西
我相信您使用的是“default”} mode (我强烈建议在Emacs中进行Python开发时尝试一下)似乎提供了您想要的:
python
模式,而所谓的^{额外细节
elpy-test
函数在内部依赖于函数(elpy-test-at-point)
,这似乎非常接近您在问题中提到的功能请参见以下屏幕截图中的代码/帮助摘录:
相关问题 更多 >
编程相关推荐