Skip to content

Port regression test 157 to Pytests #3479

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
51 changes: 51 additions & 0 deletions testsuite/pytests/sli2py_regressions/test_ticket_157.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# -*- coding: utf-8 -*-
#
# test_ticket_157.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


def test_ticket_157():
"""
Test to verify the behavior of the simulation with a specific resolution.

This test sets up a simple network with an iaf_psc_alpha neuron and a
poisson_generator_ps. It simulates the network for a specified duration
to ensure that the simulation runs without assertion failures.

Previously, this script caused a C++ assertion to fail for h==0.1, but not
for h==0.01 or h==0.001. This test ensures that the issue is resolved.
"""

h = 0.1
T = 3.0

nest.ResetKernel()
nest.SetKernelStatus({"resolution": h})

n = nest.Create("iaf_psc_alpha")
p = nest.Create("poisson_generator_ps", params={"rate": 10000.0})

nest.Connect(p, n)

nest.Simulate(T)

# If the simulation completes without exceptions, the test passes
41 changes: 0 additions & 41 deletions testsuite/regressiontests/ticket-157.sli

This file was deleted.

Loading