Lunderberg commented on PR #11657:
URL: https://github.com/apache/tvm/pull/11657#issuecomment-1152746074

   > cc @Lunderberg about the issue with linting `tvm.testing.parameter`.
   
   This was something that I had experimented with when writing it, and there 
isn't a good way around it.  The exact name must match in both the global scope 
of the module and in the argument list of the test function, so there is no 
name that would satisfy both `UPPER_CASE_CONSTANT` and `lower_case_parameter`.  
The overall constraints were:
   
   * The name of the pytest fixture must be an exact match to its later use.
   * The pytest fixture must appear in global scope of the module.  There were 
some cases which IIRC were related to caching, where using `inspect` to place 
it in the calling scope wouldn't be sufficient, because the calling scope may 
not be the parent scope.  Walking up until we reach module scope wouldn't work, 
as parameters/fixtures may be at class scope instead.
   * The pytest fixture must appear in the argument names of the test that uses 
it.  There are workarounds, such as `request.getfixturevalue`, but those break 
test parametrization, because the fixture use isn't known until run-time, but 
is required at collect-time.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to