mirror of
https://github.com/pybind/pybind11.git
synced 2026-03-14 20:27:47 +00:00
* Add test_perf_accessors (to be merged into test_pytypes). * Python < 3.8 f-string compatibility * Use thread_local in inc_ref_counter() * Intentional breakage, brute-force way to quickly find out how many platforms reach the PYBIND11_HANDLE_REF_DEBUG code, with and without threads. * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Remove Intentional breakage * Drop perf test, move inc_refs tests to test_pytypes * Fold in PR #3970 with `#ifdef`s * Complete test coverage for all newly added code. * Condense new unit tests via a simple local helper macro. * Remove PYBIND11_PR3970 define. See https://github.com/pybind/pybind11/pull/3977#issuecomment-1142526417 * Move static keyword first (fixes silly oversight). Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
b24c5ed204
commit
9f7b3f735a
@@ -317,6 +317,15 @@ def test_accessors():
|
||||
assert d["var"] == 99
|
||||
|
||||
|
||||
def test_accessor_moves():
|
||||
inc_refs = m.accessor_moves()
|
||||
if inc_refs:
|
||||
# To be changed in PR #3970: [1, 0, 1, 0, ...]
|
||||
assert inc_refs == [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
|
||||
else:
|
||||
pytest.skip("Not defined: PYBIND11_HANDLE_REF_DEBUG")
|
||||
|
||||
|
||||
def test_constructors():
|
||||
"""C++ default and converting constructors are equivalent to type calls in Python"""
|
||||
types = [bytes, bytearray, str, bool, int, float, tuple, list, dict, set]
|
||||
|
||||
Reference in New Issue
Block a user