prometheus-fastapi-instrumentator icon indicating copy to clipboard operation
prometheus-fastapi-instrumentator copied to clipboard

Any reason why the very similar function `reset_prometheus` is copy&pasted multiple times in your tests?

Open petarmaric opened this issue 10 months ago • 1 comments

Let's say that the canonical version is here: https://github.com/trallnag/prometheus-fastapi-instrumentator/blob/c0813def118754db109a435d154351a680eede8e/tests/helpers/utils.py#L16-L28

I see pretty much the same code again in other test files, such as:

  • https://github.com/trallnag/prometheus-fastapi-instrumentator/blob/c0813def118754db109a435d154351a680eede8e/tests/test_expose.py#L61-L74
  • https://github.com/trallnag/prometheus-fastapi-instrumentator/blob/c0813def118754db109a435d154351a680eede8e/tests/test_instrumentation.py#L26-L39
  • https://github.com/trallnag/prometheus-fastapi-instrumentator/blob/c0813def118754db109a435d154351a680eede8e/tests/test_instrumentator_expose.py#L15-L28

petarmaric avatar Apr 24 '24 17:04 petarmaric

It needs to be refactored. I will work on it. Thanks for your announcing.

FaridFArab avatar May 14 '24 05:05 FaridFArab