MCPcopy Create free account
hub / github.com/Kaggle/docker-python / create_test_kagglehub_server

Function create_test_kagglehub_server

tests/utils/kagglehub.py:49–62  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

47
48@contextmanager
49def create_test_kagglehub_server():
50 env = EnvironmentVarGuard()
51 env.set('KAGGLE_API_ENVIRONMENT', 'TEST')
52 with env:
53 endpoint = get_endpoint(get_env())
54 test_server_address = urlparse(endpoint)
55
56 with HTTPServer((test_server_address.hostname, test_server_address.port), KaggleAPIHandler) as httpd:
57 threading.Thread(target=httpd.serve_forever).start()
58
59 try:
60 yield httpd
61 finally:
62 httpd.shutdown()
63
64

Callers 2

test_fitMethod · 0.90
test_inferenceMethod · 0.90

Calls

no outgoing calls

Tested by 2

test_fitMethod · 0.72
test_inferenceMethod · 0.72