cccs-Dustin commented on PR #20892:
URL: https://github.com/apache/superset/pull/20892#issuecomment-1239421265

   Hi @dpgaspar & @betodealmeida! I am tagging you on this comment as 
@michael-s-molina said you two were who I should go to with this question about 
Pytest.
   
   I am currently working on adding the new back-end code for tagging datasets, 
however, when it comes to the integration tests, I am running into a brick wall 
so to speak. I am trying to mock the `TAGGING_SYSTEM` feature flag in my tests, 
however, it does not seem to be working. When I manually go into the `superset 
> connectors > sqla > models.py` (Dataset) file around like 2542 where it 
checks if the flag is enabled, if I take that check out, the test passes. Same 
thing with all of the other objects I am testing (`superset > models ? core.py` 
(Saved Query - line 850), `superset > models > dashboard.py` (Dashboard - line 
458), and `superset > models > slice.py` (Chart - line 371)).
   
   I have tried all sorts of different methods to mock the feature flag (as you 
can see by all the commits on my PR: 
https://github.com/apache/superset/pull/20892), but I have not been successful 
as of yet.
   
   Michael did mention this, but I am still not sure how to fix the tests: "I 
think using @with_feature_flags(TAGGING_SYSTEM=True) like the other tests would 
be sufficient. I think it’s failing because the events in models.py are being 
registered when the module is loaded, which happens before the tests’ 
decorators/mocks. At that time, the flag is false"


-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to