aboutsummaryrefslogtreecommitdiffstats
path: root/3rdparty/pybind11/tests/test_copy_move.py
diff options
context:
space:
mode:
authorMiodrag Milanović <mmicko@gmail.com>2021-01-02 11:16:49 +0100
committerGitHub <noreply@github.com>2021-01-02 11:16:49 +0100
commit9b9628047c01a970cfe20f83f2b7129ed109440d (patch)
tree1db418e9a889dc6fbe6199c5259aac9bd8cbb32f /3rdparty/pybind11/tests/test_copy_move.py
parentc6cdf30501dcb2da01361229dd66a05dad73a132 (diff)
parent61b07bc9a664d6a88b85aae99f9756d7569688a9 (diff)
downloadnextpnr-9b9628047c01a970cfe20f83f2b7129ed109440d.tar.gz
nextpnr-9b9628047c01a970cfe20f83f2b7129ed109440d.tar.bz2
nextpnr-9b9628047c01a970cfe20f83f2b7129ed109440d.zip
Merge pull request #549 from YosysHQ/update
Update pybind11 version and fix for future python versions
Diffstat (limited to '3rdparty/pybind11/tests/test_copy_move.py')
-rw-r--r--3rdparty/pybind11/tests/test_copy_move.py21
1 files changed, 17 insertions, 4 deletions
diff --git a/3rdparty/pybind11/tests/test_copy_move.py b/3rdparty/pybind11/tests/test_copy_move.py
index 0e671d96..7e3cc168 100644
--- a/3rdparty/pybind11/tests/test_copy_move.py
+++ b/3rdparty/pybind11/tests/test_copy_move.py
@@ -1,3 +1,4 @@
+# -*- coding: utf-8 -*-
import pytest
from pybind11_tests import copy_move_policies as m
@@ -18,7 +19,11 @@ def test_move_and_copy_casts():
"""Cast some values in C++ via custom type casters and count the number of moves/copies."""
cstats = m.move_and_copy_cstats()
- c_m, c_mc, c_c = cstats["MoveOnlyInt"], cstats["MoveOrCopyInt"], cstats["CopyOnlyInt"]
+ c_m, c_mc, c_c = (
+ cstats["MoveOnlyInt"],
+ cstats["MoveOrCopyInt"],
+ cstats["CopyOnlyInt"],
+ )
# The type move constructions/assignments below each get incremented: the move assignment comes
# from the type_caster load; the move construction happens when extracting that via a cast or
@@ -42,7 +47,11 @@ def test_move_and_copy_loads():
moves/copies."""
cstats = m.move_and_copy_cstats()
- c_m, c_mc, c_c = cstats["MoveOnlyInt"], cstats["MoveOrCopyInt"], cstats["CopyOnlyInt"]
+ c_m, c_mc, c_c = (
+ cstats["MoveOnlyInt"],
+ cstats["MoveOrCopyInt"],
+ cstats["CopyOnlyInt"],
+ )
assert m.move_only(10) == 10 # 1 move, c_m
assert m.move_or_copy(11) == 11 # 1 move, c_mc
@@ -65,12 +74,16 @@ def test_move_and_copy_loads():
assert c_m.alive() + c_mc.alive() + c_c.alive() == 0
-@pytest.mark.skipif(not m.has_optional, reason='no <optional>')
+@pytest.mark.skipif(not m.has_optional, reason="no <optional>")
def test_move_and_copy_load_optional():
"""Tests move/copy loads of std::optional arguments"""
cstats = m.move_and_copy_cstats()
- c_m, c_mc, c_c = cstats["MoveOnlyInt"], cstats["MoveOrCopyInt"], cstats["CopyOnlyInt"]
+ c_m, c_mc, c_c = (
+ cstats["MoveOnlyInt"],
+ cstats["MoveOrCopyInt"],
+ cstats["CopyOnlyInt"],
+ )
# The extra move/copy constructions below come from the std::optional move (which has to move
# its arguments):