Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
gaoqiong
pybind11
Commits
d9b29d59
Commit
d9b29d59
authored
Oct 18, 2020
by
Ralf W. Grosse-Kunstleve
Browse files
fixing accident in merge conflict resolution + black reformatting
parent
783a58ea
Pipeline
#499
failed with stages
in 0 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
14 deletions
+8
-14
tests/test_eval.py
tests/test_eval.py
+1
-1
tests/test_pytypes.py
tests/test_pytypes.py
+7
-13
No files found.
tests/test_eval.py
View file @
d9b29d59
...
...
@@ -23,7 +23,7 @@ def test_evals(capture):
def
test_eval_file
():
filename
=
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
"test_eval_call.py"
)
if
env
.
PY2
:
filename
=
filename
.
decode
(
'
utf-8
'
)
filename
=
filename
.
decode
(
"
utf-8
"
)
assert
m
.
test_eval_file
(
filename
)
assert
m
.
test_eval_file_failure
()
...
...
tests/test_pytypes.py
View file @
d9b29d59
...
...
@@ -125,14 +125,18 @@ def test_str(doc):
with
pytest
.
raises
(
UnicodeDecodeError
):
m
.
str_from_object
(
malformed_utf8
)
else
:
m
.
str_from_object
(
malformed_utf8
)
is
malformed_utf8
# To be fixed; see #2380
m
.
str_from_object
(
malformed_utf8
)
is
malformed_utf8
# To be fixed; see #2380
with
pytest
.
raises
(
UnicodeDecodeError
):
m
.
str_from_handle
(
malformed_utf8
)
else
:
if
hasattr
(
m
,
"has_str_non_permissive"
):
assert
m
.
str_from_object
(
malformed_utf8
)
==
"b'
\\
x80'"
else
:
assert
m
.
str_from_object
(
malformed_utf8
)
is
malformed_utf8
# To be fixed; see #2380
assert
(
m
.
str_from_object
(
malformed_utf8
)
is
malformed_utf8
)
# To be fixed; see #2380
assert
m
.
str_from_handle
(
malformed_utf8
)
==
"b'
\\
x80'"
...
...
@@ -306,15 +310,6 @@ def test_pybind11_str_raw_str():
valid_orig
=
u
"DZ"
valid_utf8
=
valid_orig
.
encode
(
"utf-8"
)
valid_cvt
=
cvt
(
valid_utf8
)
<<<<<<<
HEAD
assert
type
(
valid_cvt
)
==
bytes
# Probably surprising.
assert
valid_cvt
==
b
"
\xc7\xb1
"
malformed_utf8
=
b
"
\x80
"
malformed_cvt
=
cvt
(
malformed_utf8
)
assert
type
(
malformed_cvt
)
==
bytes
# Probably surprising.
assert
malformed_cvt
==
b
"
\x80
"
=======
if
hasattr
(
m
,
"has_str_non_permissive"
):
assert
type
(
valid_cvt
)
is
unicode
if
env
.
PY2
else
str
# noqa: F821
if
env
.
PY2
:
...
...
@@ -324,7 +319,7 @@ def test_pybind11_str_raw_str():
else
:
assert
valid_cvt
is
valid_utf8
malformed_utf8
=
b
'
\x80
'
malformed_utf8
=
b
"
\x80
"
if
hasattr
(
m
,
"has_str_non_permissive"
):
if
env
.
PY2
:
with
pytest
.
raises
(
UnicodeDecodeError
):
...
...
@@ -335,7 +330,6 @@ def test_pybind11_str_raw_str():
assert
malformed_cvt
==
u
"b'
\\
x80'"
else
:
assert
cvt
(
malformed_utf8
)
is
malformed_utf8
>>>>>>>
58
c1719
(
Meta
PR
for
Google
Patches
)
def
test_implicit_casting
():
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment