DEV Community

Cover image for Loop on fail - Small Pytest Trick to Boost Your Productivity
Moshe Zada
Moshe Zada

Posted on

Loop on fail - Small Pytest Trick to Boost Your Productivity

While reading pytest-xdist docs I came across a very interesting flag

-f, --looponfail    run tests in subprocess, wait for modified files
                    and re-run failing test set until all pass.

Amazing! especially if you have slow tests and you want faster feedback loop.
All you need to do is to install the pytest-xdist plugin
pip install pytest-xdist
and then run your tests with -f switch.
Now pytest will watch for file changes and run failing tests

Found this post useful? Add a star⭐️ to my Github project🙂

GitHub logo moshe / elasticsearch-comrade

Elasticsearch admin panel built for ops and monitoring

Elasticsearch Comrade Twitter Follow python docker pulls CircleCI GitHub issues GitHub license

Elasticsearch Comrade is an open-source Elasticsearch admin and monitoring panel highly inspired by Cerebro. Elasticsearch Comrade built with python3, VueJS, Sanic, Vuetify2 and Cypress Alt text Alt text

Main Features

  • Elasticsearch version 5,6 and 7 support (tested against elasticsearch 7.7)
  • Multi cluster
  • Rest API with autocompletion, history, templates, and history
  • SQL editor (version 7 only)
  • Built for big clusters
  • Node statistics and monitoring
  • Manage aliases
  • Inspect running tasks
  • Manage index templates
  • Manage snapshots
  • And much more ...


Cluster dir definitaions

Comrade discovers clusters using the --clusters-dir param, docs are here, examples are here

Using docker (recommended)

docker run -v $PWD/clusters/:/app/comrade/clusters/ -it -p 8000:8000 mosheza/elasticsearch-comrade

Using the python package

pip install elasticsearch-comrade
comrade --clusters-dir clusters

Installation, configuration and next steps




  • Add python package
  • Reindex screen
  • Comrade dashboard


  • Cluster settings screen
  • Evacuate node from shards
  • Add commrade version indicator to footer


  • Beats screen
  • Threadpools screen


Alt text Alt text Alt text Alt text Alt text

Oldest comments (0)