MCPcopy Create free account
hub / github.com/apache/arrow / inject_cpp_tests

Function inject_cpp_tests

python/pyarrow/tests/test_cpp_internals.py:26–41  ·  view source on GitHub ↗

Inject C++ tests as Python functions into namespace `ns` (a dict).

(ns)

Source from the content-addressed store, hash-verified

24
25
26def inject_cpp_tests(ns):
27 """
28 Inject C++ tests as Python functions into namespace `ns` (a dict).
29 """
30 for case in get_cpp_tests():
31
32 def wrapper(case=case):
33 case()
34 wrapper.__name__ = wrapper.__qualname__ = case.name
35 wrapper.__module__ = ns['__name__']
36 # Add numpy or pandas marks if the test requires it
37 if 'numpy' in case.name:
38 wrapper = pytest.mark.numpy(wrapper)
39 elif 'pandas' in case.name:
40 wrapper = pytest.mark.pandas(wrapper)
41 ns[case.name] = wrapper
42
43
44inject_cpp_tests(globals())

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected