Skip to content

Port regression test 735 to Pytests #3480

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 24, 2025
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
61 changes: 61 additions & 0 deletions testsuite/pytests/sli2py_regressions/test_issue_735.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# -*- coding: utf-8 -*-
#
# test_issue_735.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/>.

import nest
import pytest


@pytest.mark.parametrize("use_param_on_connect", [True, False])
@pytest.mark.parametrize("copy_model", [True, False])
@pytest.mark.parametrize("param_name", ["A_minus", "A_plus", "Wmax", "Wmin", "b", "tau_c", "tau_n", "tau_plus"])
def test_issue_735(use_param_on_connect, copy_model, param_name):
"""
Regression test for Issue #735 (GitHub).

This test ensures that NEST raises an error if the user tries to set stdp parameters
in ways that are not supported for stdp_dopamine_synapse.
"""

nest.ResetKernel()

n = nest.Create("iaf_psc_alpha")
vt = nest.Create("volume_transmitter")

if copy_model:
nest.CopyModel("stdp_dopamine_synapse", "mysyn", {"volume_transmitter": vt})
syn_model = "mysyn"
else:
nest.SetDefaults("stdp_dopamine_synapse", {"volume_transmitter": vt})
syn_model = "stdp_dopamine_synapse"

if use_param_on_connect:
with pytest.raises(nest.kernel.NESTErrors.NotImplemented):
nest.Connect(
n,
n,
conn_spec={"rule": "one_to_one"},
syn_spec={"synapse_model": syn_model, "weight": 2.0, param_name: 1.0},
)
else:
nest.Connect(n, n, syn_spec={"synapse_model": syn_model, "weight": 2.0})
conns = nest.GetConnections()
with pytest.raises(nest.kernel.NESTErrors.DictError):
conns.set({param_name: 1.0, "weight": 2.0})
111 changes: 0 additions & 111 deletions testsuite/regressiontests/issue-735.sli

This file was deleted.

Loading