diff --git a/nipype/interfaces/base/tests/test_support.py b/nipype/interfaces/base/tests/test_support.py index 3997a88280..6bac7d0852 100644 --- a/nipype/interfaces/base/tests/test_support.py +++ b/nipype/interfaces/base/tests/test_support.py @@ -35,7 +35,7 @@ def test_bunch_methods(): assert b.get("a") == 3 assert b.get("badkey", "otherthing") == "otherthing" assert b != newb - assert type(dict()) == type(newb) + assert type(dict()) is type(newb) assert newb["a"] == 3 diff --git a/nipype/interfaces/fsl/tests/test_base.py b/nipype/interfaces/fsl/tests/test_base.py index 2b07381e81..1a76d0f6a5 100644 --- a/nipype/interfaces/fsl/tests/test_base.py +++ b/nipype/interfaces/fsl/tests/test_base.py @@ -37,7 +37,7 @@ def test_FSLCommand(): # testing the one item that is not. cmd = fsl.FSLCommand(command="ls") res = cmd.run() - assert type(res) == InterfaceResult + assert type(res) is InterfaceResult @pytest.mark.skipif(no_fsl(), reason="fsl is not installed") diff --git a/nipype/pipeline/engine/tests/test_workflows.py b/nipype/pipeline/engine/tests/test_workflows.py index 9b06eb56bb..12d56de285 100644 --- a/nipype/pipeline/engine/tests/test_workflows.py +++ b/nipype/pipeline/engine/tests/test_workflows.py @@ -20,7 +20,7 @@ def test_init(): with pytest.raises(TypeError): pe.Workflow() pipe = pe.Workflow(name="pipe") - assert type(pipe._graph) == nx.DiGraph + assert type(pipe._graph) is nx.DiGraph def test_connect(): diff --git a/nipype/scripts/utils.py b/nipype/scripts/utils.py index 77e7231bea..8d8dc52627 100644 --- a/nipype/scripts/utils.py +++ b/nipype/scripts/utils.py @@ -71,12 +71,12 @@ def add_args_options(arg_parser, interface): if not spec.is_trait_type(traits.TraitCompound): trait_type = type(spec.trait_type.default_value) if trait_type in (bytes, str, int, float): - if trait_type == bytes: + if trait_type is bytes: trait_type = str args["type"] = trait_type elif len(spec.inner_traits) == 1: trait_type = type(spec.inner_traits[0].trait_type.default_value) - if trait_type == bytes: + if trait_type is bytes: trait_type = str if trait_type in (bytes, bool, str, int, float): args["type"] = trait_type