def METHOD_NAME(extra_pythonpath, tmp_config_path):
    # Disable and then enable a package scan result.
    try:
        drivers = intake.source.discovery.DriverSouces(do_scan=True)
        registry = intake.source.DriverRegistry(drivers)
        assert "foo" in registry
        drivers.disable("foo")
        with pytest.warns(PendingDeprecationWarning):
            assert "foo" in discovery.drivers.scanned
        assert "foo" not in registry
        drivers.enable("foo", "intake_foo.FooPlugin")
        assert "foo" in registry
    finally:
        drivers.enable("foo", "intake_foo.FooPlugin")
    # Disable and then enable an entrypoint result.
    try:
        drivers.disable("some_test_driver")
        assert "some_test_driver" not in registry
        drivers.enable("some_test_driver", "driver_with_entrypoints.SomeTestDriver")
        assert "some_test_driver" in registry
    finally:
        drivers.enable("some_test_driver", "driver_with_entrypoints.SomeTestDriver")