Skip to content

Commit 0604e39

Browse files
committed
Refactor internal scope handling by introducing Scope enum
This replaces the internal use of string literals and "scopenum" to a proper Scope enum, which also centralizes indexes, getting higher scopes, get next scope in the order, etc. Another benefit is that it helps the type checker by introducing a proper type, and improve readability (IMHO). This is _mostly_ an internal change, however due to historical reasons, the API of the following _internal_ objects has changed slightly: * `CallSpec2`: `_arg2scopenum` renamed to `_arg2scope` for consistency. * `FixtureRequest`: Previously contained a `scope: str` attribute. Changed attribute to `_scope: Scope`, with a backward compatible read-only property `scope -> str`. This one might cause some confusion, because the internal attribute has a different type than the public property of the same name. * `SubRequest.__init__` parameter changed from `_Scope` to `Scope`.
1 parent 940c6e2 commit 0604e39

File tree

7 files changed

+239
-162
lines changed

7 files changed

+239
-162
lines changed

0 commit comments

Comments
 (0)