Skip to content

Commit 3bc9c58

Browse files
STY: Apply ruff/pycodestyle rule E721
E721 Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks
1 parent 5f6d492 commit 3bc9c58

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

nipype/interfaces/base/tests/test_support.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def test_bunch_methods():
3535
assert b.get("a") == 3
3636
assert b.get("badkey", "otherthing") == "otherthing"
3737
assert b != newb
38-
assert type(dict()) == type(newb)
38+
assert type(dict()) is type(newb)
3939
assert newb["a"] == 3
4040

4141

nipype/interfaces/fsl/tests/test_base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def test_FSLCommand():
3737
# testing the one item that is not.
3838
cmd = fsl.FSLCommand(command="ls")
3939
res = cmd.run()
40-
assert type(res) == InterfaceResult
40+
assert type(res) is InterfaceResult
4141

4242

4343
@pytest.mark.skipif(no_fsl(), reason="fsl is not installed")

nipype/pipeline/engine/tests/test_workflows.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def test_init():
2020
with pytest.raises(TypeError):
2121
pe.Workflow()
2222
pipe = pe.Workflow(name="pipe")
23-
assert type(pipe._graph) == nx.DiGraph
23+
assert type(pipe._graph) is nx.DiGraph
2424

2525

2626
def test_connect():

nipype/scripts/utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,12 @@ def add_args_options(arg_parser, interface):
7171
if not spec.is_trait_type(traits.TraitCompound):
7272
trait_type = type(spec.trait_type.default_value)
7373
if trait_type in (bytes, str, int, float):
74-
if trait_type == bytes:
74+
if trait_type is bytes:
7575
trait_type = str
7676
args["type"] = trait_type
7777
elif len(spec.inner_traits) == 1:
7878
trait_type = type(spec.inner_traits[0].trait_type.default_value)
79-
if trait_type == bytes:
79+
if trait_type is bytes:
8080
trait_type = str
8181
if trait_type in (bytes, bool, str, int, float):
8282
args["type"] = trait_type

0 commit comments

Comments
 (0)