Is it documented anywhere that each test gets their own instance of the class? I was a little shocked when I figured that out.
I also think it would make sense to change the behavior so that every test within a class shared the same instance of the class.
_Originally posted by @szegel in https://github.com/pytest-dev/pytest/issues/6890#issuecomment-597828312_
Probably worth adding why creating classes is useful sometimes: https://github.com/pytest-dev/pytest/issues/6890#issuecomment-597791890 https://github.com/pytest-dev/pytest/issues/6890#issuecomment-597430676
wrt test isolation its horrendous if items shared instances of the class
But I think that is a good thing. If you want test isolation, use separate test classes.
Hello, I was wondering if you want an Arabic translator? so the project can reach a wider audience.
Hi @Abdullah-alfadhel!
First of all, thanks a lot for the offer, we really appreciate it! Reaching a wider audience is something we really would like. However, we had docs translated in the past to Japanese, and while the work is great, it gets out of sync fast with the English documentation (which is always changing). There are solutions out there for internationalization, but we don't have those inplace right now, and until we do, it is really not worth starting something in that direction.
I've created however #6922 to track this idea, thanks for bringing it to attention. 馃憤
I'd like to work on the issue of adding documentation that each test gets its own instance of the class.
Please go ahead. 馃憤
i am taking this up since @gdhameeja has not responded back.
Where in the docs would I make this change?
PR approved, will be closed shortly
Most helpful comment
wrt test isolation its horrendous if items shared instances of the class