Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ jobs:

- name: Update CMake
uses: jwlawson/actions-setup-cmake@v1.4
with:
cmake-version: 3.19.1

- name: Cache wheels
if: runner.os == 'macOS'
Expand Down Expand Up @@ -550,6 +552,8 @@ jobs:

- name: Update CMake
uses: jwlawson/actions-setup-cmake@v1.4
with:
cmake-version: 3.19.1

- name: Prepare MSVC
uses: ilammy/msvc-dev-cmd@v1
Expand Down Expand Up @@ -596,6 +600,8 @@ jobs:

- name: Update CMake
uses: jwlawson/actions-setup-cmake@v1.4
with:
cmake-version: 3.19.1

- name: Prepare MSVC
uses: ilammy/msvc-dev-cmd@v1
Expand Down Expand Up @@ -650,6 +656,8 @@ jobs:

- name: Update CMake
uses: jwlawson/actions-setup-cmake@v1.4
with:
cmake-version: 3.19.1

- name: Prepare env
run: python -m pip install -r tests/requirements.txt --prefer-binary
Expand Down
22 changes: 11 additions & 11 deletions tests/test_enum.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,25 +73,25 @@ def test_unscoped_enum():
assert not (y == "2")

with pytest.raises(TypeError):
y < object()
y < object() # noqa: B015

with pytest.raises(TypeError):
y <= object()
y <= object() # noqa: B015

with pytest.raises(TypeError):
y > object()
y > object() # noqa: B015

with pytest.raises(TypeError):
y >= object()
y >= object() # noqa: B015

with pytest.raises(TypeError):
y | object()
y | object() # noqa: B015

with pytest.raises(TypeError):
y & object()
y & object() # noqa: B015

with pytest.raises(TypeError):
y ^ object()
y ^ object() # noqa: B015

assert int(m.UnscopedEnum.ETwo) == 2
assert str(m.UnscopedEnum(2)) == "UnscopedEnum.ETwo"
Expand Down Expand Up @@ -134,13 +134,13 @@ def test_scoped_enum():
assert not (z == object())
# Scoped enums will *NOT* accept >, <, >= and <= int comparisons (Will throw exceptions)
with pytest.raises(TypeError):
z > 3
z > 3 # noqa: B015
with pytest.raises(TypeError):
z < 3
z < 3 # noqa: B015
with pytest.raises(TypeError):
z >= 3
z >= 3 # noqa: B015
with pytest.raises(TypeError):
z <= 3
z <= 3 # noqa: B015

# order
assert m.ScopedEnum.Two < m.ScopedEnum.Three
Expand Down
2 changes: 1 addition & 1 deletion tests/test_local_bindings.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ def test_stl_caster_vs_stl_bind(msg):
v2 = [1, 2, 3]
assert m.load_vector_via_caster(v2) == 6
with pytest.raises(TypeError) as excinfo:
cm.load_vector_via_binding(v2) == 6
cm.load_vector_via_binding(v2)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think B015 helps in cases like this. It clarifies the test is really about the call, and not the comparison, which never happens.

assert (
msg(excinfo.value)
== """
Expand Down