heynemann / pyvows

Python implementation of Vows.js

Home Page:http://pyvows.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Is it possible to run some tests not in parallel?

lorddaren opened this issue · comments

I have several cases where I am mocking the topic and need to mock it in different ways, but because of the vows running in parallel they are overriding each other's mocks.

I have tried nesting the vows into different contexts but still have the same issue. Any thoughts?

If the contexts are nested, they must be run sequentially. If they are not running like that, it's a bug. Can you submit a test case that showcases the issue?

Yeah a sample would be nice to see this. It sounds more like the problem isn't the contexts but the vows instead. Even if you put different vows in subcontexts, it would definitely still be possible to have vows from different contexts running in non-deterministic order I think because the only guarantee is the order of topic execution for subcontexts. In other words, there isn't a guarantee that vows from the subcontext run after the vows for the parent context.

@heynemann I just hit this problem with thumbor: https://github.com/masom/thumbor/commit/1bca4cea9aa35a14b790394329bda869b3f89e7d

Thumbor RedisStorage uses a singleton in: https://github.com/masom/thumbor/blob/master/thumbor/storages/redis_storage.py#L29

If the test runs concurrently with the others unexpected behaviour happens all the time.