diff --git a/testsuite/pytests/sli2py_regressions/test_issue_1242.py b/testsuite/pytests/sli2py_regressions/test_issue_1242.py
new file mode 100644
index 0000000000..9074908a56
--- /dev/null
+++ b/testsuite/pytests/sli2py_regressions/test_issue_1242.py
@@ -0,0 +1,44 @@
+# -*- coding: utf-8 -*-
+#
+# test_issue_1242.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 .
+
+"""
+Regression test for Issue #1242 (GitHub).
+"""
+
+import pytest
+
+import nest
+
+
+def test_volume_transmitter_illegal_connection():
+ """
+ Test that volume transmitter throws an error for illegal connection.
+
+ The test ensures that a connection from a node without proxies to
+ a node without proxies that has global targets throws an error
+ (instead of failing silently or resulting in inconsistent results).
+ """
+
+ sg = nest.Create("spike_generator")
+ vt = nest.Create("volume_transmitter")
+
+ with pytest.raises(nest.kernel.NESTErrors.IllegalConnection):
+ nest.Connect(sg, vt)
diff --git a/testsuite/regressiontests/issue-1242.sli b/testsuite/regressiontests/issue-1242.sli
deleted file mode 100644
index 1ecf38c700..0000000000
--- a/testsuite/regressiontests/issue-1242.sli
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * issue-1242.sli
- *
- * 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 .
- *
- */
-
-
- /** @BeginDocumentation
-Name: testsuite::issue-1242
-
-Synopsis: (issue-1242) run -> NEST exits if test fails
-
-Description:
-Tests that a connection from a node without proxies to
-a node without proxies that has global targets throws an error
-(instead of failing silently or resulting in inconsistent results).
-
-Author: Jan Hahne
-FirstVersion: July 2019
-*/
-
-(unittest) run
-/unittest using
-
-M_ERROR setverbosity
-
-% Check if such a connection results in an exception
-{
- ResetKernel
-
- /spike_generator Create /sg Set
- /volume_transmitter Create /vt Set
- sg vt Connect
-}
-fail_or_die
-
-endusing