Skip to content
Myr

add test for lazy loading error

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by David Lord · committed by David Lord · parent aa6dd09 · Browse files · 1 file+17 added−4 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+17 added−4 removed

  • tests:+17 added−4 removed

1 file+17 added−4 removed

modified:tests/test_cli.py+17 added-4 removed
309 unmodified lines
310 app = obj.load_app()311 assert app.name == "testapp"312313314def test_lazy_load_error(monkeypatch):315 """When using lazy loading, the correct exception should be316 re-raised.317 """318319 class BadExc(Exception):320 pass321322 def bad_load():323 raise BadExc324325 lazy = DispatchingApp(bad_load, use_eager_loading=False)326327 with pytest.raises(BadExc):328 lazy._flush_bg_loading_exception()329330331def test_with_appcontext(runner):332 @click.command()333 @with_appcontext334 def testcmd():
341 unmodified lines
676 if int(click.__version__[0]) < 8:677 pytest.deprecated_call(cli_main, match=".* Click 7 is deprecated")678 else:679 cli_main()663664665def test_load_in_background():666 pytest.raises(Exception, DispatchingApp, "appname123")