Skip to content

Commit 344e537

Browse files
committed
Test preserving assignment not recognised as parameter
1 parent 2392595 commit 344e537

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

tests/sample.ipynb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
"print(\"This should be ignored\")\n",
2929
"\n",
3030
"café = \"καφές\" # Not only ASCII\n",
31+
"other_assignment = b ** 2 # Not recognised as a parameter\n",
3132
"\n",
3233
"def func():\n",
3334
" not_a_parameter = 5 # Should not be found\n",

tests/test_basic.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,9 @@ def test_rebuild(self):
6262
assert ns['d'] == True
6363
assert ns['café'] == "καφές"
6464

65-
# Function should be preserved
65+
# Function & non parameter assignment should be preserved
6666
assert ns['func']() == 0.25
67+
assert ns['other_assignment'] == 21 ** 2
6768

6869
def test_rebuild_from_dict(self):
6970
new_params = self.param_dict.copy()
@@ -84,8 +85,9 @@ def test_rebuild_from_dict(self):
8485
assert ns['café'] == "καφές"
8586
assert ns['thé'] == "चाय"
8687

87-
# Function should be preserved
88+
# Function & non parameter assignment should be preserved
8889
assert ns['func']() == 0.75
90+
assert ns['other_assignment'] == 12 ** 2
8991

9092
def test_new_values(self):
9193
params = code.parameter_values(self.params,

0 commit comments

Comments
 (0)