Skip to content

Port regression test 888 to Pytests #3482

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
45 changes: 45 additions & 0 deletions testsuite/pytests/sli2py_regressions/test_issue_888.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# -*- coding: utf-8 -*-
#
# test_issue_888.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_issue_888():
"""
Ensure that the resolution is set as a multiple of tics.

This test verifies that setting the resolution without specifying the tics per ms
results in an error. It also checks that setting both the resolution and tics per ms
to incompatible values results in an error.

Author: Håkon Mørk, 2018-03-05
"""

# Only setting resolution should fail
with pytest.raises(Exception):
nest.ResetKernel()
nest.SetKernelStatus({"resolution": 0.03125})

# Setting both resolution and tics per ms to incompatible values should fail
with pytest.raises(Exception):
nest.ResetKernel()
nest.SetKernelStatus({"tics_per_ms": 1000.0, "resolution": 0.03125})
47 changes: 0 additions & 47 deletions testsuite/regressiontests/issue-888.sli

This file was deleted.

Loading