Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reset config.defer_load to its initial value in a unit test #5285

Merged
merged 1 commit into from
Jul 19, 2023

Conversation

maximlt
Copy link
Member

@maximlt maximlt commented Jul 19, 2023

#5244 made a change/fix to pn.config that consists of calling the watchers of a config Parameter when its value is set in a curdoc context. I think that exposed a bug in the test suite where a unit test was setting config.defer_load to True without resetting it to False. There's indeed a global callback that updates ParamMethod when config.defer_load changes, which wasn't triggered before #5244, but is now triggered and made test_get_param_function_pane_type fail:

panel/panel/param.py

Lines 946 to 948 in bc62716

@param.depends(config.param.defer_load, watch=True)
def _update_defer_load_default(default_value):
ParamMethod.param.defer_load.default = default_value

This should fix the test suite that is currently failing.

@codecov
Copy link

codecov bot commented Jul 19, 2023

Codecov Report

Merging #5285 (bc62716) into main (d84d043) will increase coverage by 43.26%.
The diff coverage is 87.50%.

@@             Coverage Diff             @@
##             main    #5285       +/-   ##
===========================================
+ Coverage   40.54%   83.81%   +43.26%     
===========================================
  Files         274      274               
  Lines       39684    39699       +15     
===========================================
+ Hits        16089    33272    +17183     
+ Misses      23595     6427    -17168     
Flag Coverage Δ
ui-tests 40.52% <0.00%> (-0.02%) ⬇️
unitexamples-tests 73.76% <87.50%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
panel/tests/test_config.py 99.18% <87.50%> (+84.89%) ⬆️

... and 197 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Member

@philippjfr philippjfr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@philippjfr philippjfr merged commit b53884c into main Jul 19, 2023
@philippjfr philippjfr deleted the fix_defer_load_test branch July 19, 2023 09:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants