alaex777 / freeze-uuid

Python package for mocking uuid.
MIT License
0 stars 0 forks source link

Decorators does not work with pytest. #1

Open Draqun opened 4 months ago

Draqun commented 4 months ago

Hi. I want say thank you, because your project simplify testing. Anyway there are still some problems, because I cannot use your package with pytest. If i decorate tests using pytest.mark.parametrize the test does not gain any parameters nor fixtures. It would be a greate problem for you to fix it? It is possible to freeze uuid7 form package https://github.com/stevesimmons/uuid7 too?

alaex777 commented 4 months ago

Hi, @Draqun! Thank you so much, for using ny library.

  1. The answer to your second question is yes, I mock UUID class, so all libraries, that use it, will be mocked. I've added an example of it.
  2. The answer to your first question is a lot more complex. I used it with parametrize without any problems. It seems like it works with asynchronous tests, and doesn't work with synchronous. I'll try to figure out why, asap.
alaex777 commented 4 months ago

Once again, @Draqun, hi! It seems like i've found a temporary solution in creating a context manager, which can be used inside tests with parametrize like I showed in description of 0.4.0 version.