FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
arrow/python/pyarrow/tests/test_cpp_internals.py at main · apache/arrow · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
apache
/
arrow
Public
Notifications
You must be signed in to change notification settings
Fork
4.3k
Star
17.1k
Code
Issues
2.2k
Pull requests
407
Discussions
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Discussions
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
arrow
/
python
/
pyarrow
/
tests
/
test_cpp_internals.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
57 lines (45 loc) · 1.88 KB
Breadcrumbs
arrow
/
python
/
pyarrow
/
tests
/
test_cpp_internals.py
Copy path
File metadata and controls
57 lines (45 loc) · 1.88 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
import
os
.
path
from
os
.
path
import
join
as
pjoin
import
pytest
from
pyarrow
.
_pyarrow_cpp_tests
import
get_cpp_tests
def
inject_cpp_tests
(
ns
):
"""
Inject C++ tests as Python functions into namespace `ns` (a dict).
"""
for
case
in
get_cpp_tests
():
def
wrapper
(
case
=
case
):
case
()
wrapper
.
__name__
=
wrapper
.
__qualname__
=
case
.
name
wrapper
.
__module__
=
ns
[
'__name__'
]
# Add numpy or pandas marks if the test requires it
if
'numpy'
in
case
.
name
:
wrapper
=
pytest
.
mark
.
numpy
(
wrapper
)
elif
'pandas'
in
case
.
name
:
wrapper
=
pytest
.
mark
.
pandas
(
wrapper
)
ns
[
case
.
name
]
=
wrapper
inject_cpp_tests
(
globals
())
def
test_pyarrow_include
():
# We need to make sure that pyarrow/include is always
# created. Either with PyArrow C++ header files or with
# Arrow C++ and PyArrow C++ header files together
import
pyarrow
pyarrow_include
=
pyarrow
.
get_include
()
pyarrow_cpp_include
=
pjoin
(
pyarrow_include
,
'arrow'
,
'python'
)
assert
os
.
path
.
exists
(
pyarrow_include
)
assert
os
.
path
.
exists
(
pyarrow_cpp_include
)
Back
|
FazBrowse Home
|
New Git URL