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
46 changes: 46 additions & 0 deletions testsuite/pytests/sli2py_regressions/test_issue_545.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# -*- coding: utf-8 -*-
#
# test_issue_545.py
#
# This file is part of NEST.
#
# Copyright (C) 2004 The NEST Initiative
#
# NEST is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
# NEST is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with NEST. If not, see <http://www.gnu.org/licenses/>.

"""
This test ensures that calling various setters with incorrect properties correctly raises an error.
"""

import nest
import pytest


@pytest.mark.skipif_missing_threads
def test_setters_raise_error_on_bad_properties():
nest.ResetKernel()
nest.local_num_threads = 4

# test defaults
with pytest.raises(nest.kernel.NESTErrors.BadProperty):
nest.SetDefaults("iaf_psc_alpha", {"tau_m": -10})

# test neuron
n = nest.Create("iaf_psc_alpha")
with pytest.raises(nest.kernel.NESTErrors.BadProperty):
n.set({"tau_m": -10})

# test synapse
with pytest.raises(nest.kernel.NESTErrors.BadDelay):
nest.Connect(n, n, syn_spec={"delay": -10})
77 changes: 0 additions & 77 deletions testsuite/regressiontests/issue-545.sli

This file was deleted.