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
b468a3ce
Commit
b468a3ce
authored
Jul 25, 2017
by
Jason Rhinelander
Browse files
Ignore undefined name `long` errors on Python 3
parent
3ed62218
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
tests/test_builtin_casters.py
tests/test_builtin_casters.py
+6
-6
No files found.
tests/test_builtin_casters.py
View file @
b468a3ce
...
@@ -151,10 +151,10 @@ def test_integer_casting():
...
@@ -151,10 +151,10 @@ def test_integer_casting():
assert
m
.
i32_str
(
2000000000
)
==
"2000000000"
assert
m
.
i32_str
(
2000000000
)
==
"2000000000"
assert
m
.
u32_str
(
2000000000
)
==
"2000000000"
assert
m
.
u32_str
(
2000000000
)
==
"2000000000"
if
sys
.
version_info
<
(
3
,):
if
sys
.
version_info
<
(
3
,):
assert
m
.
i32_str
(
long
(
-
1
))
==
"-1"
assert
m
.
i32_str
(
long
(
-
1
))
==
"-1"
# noqa: F821 undefined name 'long'
assert
m
.
i64_str
(
long
(
-
1
))
==
"-1"
assert
m
.
i64_str
(
long
(
-
1
))
==
"-1"
# noqa: F821 undefined name 'long'
assert
m
.
i64_str
(
long
(
-
999999999999
))
==
"-999999999999"
assert
m
.
i64_str
(
long
(
-
999999999999
))
==
"-999999999999"
# noqa: F821 undefined name
assert
m
.
u64_str
(
long
(
999999999999
))
==
"999999999999"
assert
m
.
u64_str
(
long
(
999999999999
))
==
"999999999999"
# noqa: F821 undefined name 'long'
else
:
else
:
assert
m
.
i64_str
(
-
999999999999
)
==
"-999999999999"
assert
m
.
i64_str
(
-
999999999999
)
==
"-999999999999"
assert
m
.
u64_str
(
999999999999
)
==
"999999999999"
assert
m
.
u64_str
(
999999999999
)
==
"999999999999"
...
@@ -174,10 +174,10 @@ def test_integer_casting():
...
@@ -174,10 +174,10 @@ def test_integer_casting():
if
sys
.
version_info
<
(
3
,):
if
sys
.
version_info
<
(
3
,):
with
pytest
.
raises
(
TypeError
)
as
excinfo
:
with
pytest
.
raises
(
TypeError
)
as
excinfo
:
m
.
u32_str
(
long
(
-
1
))
m
.
u32_str
(
long
(
-
1
))
# noqa: F821 undefined name 'long'
assert
"incompatible function arguments"
in
str
(
excinfo
.
value
)
assert
"incompatible function arguments"
in
str
(
excinfo
.
value
)
with
pytest
.
raises
(
TypeError
)
as
excinfo
:
with
pytest
.
raises
(
TypeError
)
as
excinfo
:
m
.
u64_str
(
long
(
-
1
))
m
.
u64_str
(
long
(
-
1
))
# noqa: F821 undefined name 'long'
assert
"incompatible function arguments"
in
str
(
excinfo
.
value
)
assert
"incompatible function arguments"
in
str
(
excinfo
.
value
)
...
...
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