ext: Update pybind11 to v2.8.1
Change-Id: Ia1c7081377f53fd470addf35526f8b28a949a7b0 Signed-off-by: Jason Lowe-Power <jason@lowepower.com> Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/52523 Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu> Tested-by: kokoro <noreply+kokoro@google.com> Reviewed-by: Gabe Black <gabe.black@gmail.com>
This commit is contained in:
committed by
Jason Lowe-Power
parent
ba5f68db3d
commit
1e8aeee698
@@ -4,7 +4,6 @@ import os
|
||||
import pytest
|
||||
|
||||
import env # noqa: F401
|
||||
|
||||
from pybind11_tests import eval_ as m
|
||||
|
||||
|
||||
@@ -33,3 +32,20 @@ def test_eval_empty_globals():
|
||||
g = {}
|
||||
assert "__builtins__" in m.eval_empty_globals(g)
|
||||
assert "__builtins__" in g
|
||||
|
||||
|
||||
def test_eval_closure():
|
||||
global_, local = m.test_eval_closure()
|
||||
|
||||
assert global_["closure_value"] == 42
|
||||
assert local["closure_value"] == 0
|
||||
|
||||
assert "local_value" not in global_
|
||||
assert local["local_value"] == 0
|
||||
|
||||
assert "func_global" not in global_
|
||||
assert local["func_global"]() == 42
|
||||
|
||||
assert "func_local" not in global_
|
||||
with pytest.raises(NameError):
|
||||
local["func_local"]()
|
||||
|
||||
Reference in New Issue
Block a user