File tree Expand file tree Collapse file tree 2 files changed +12
-9
lines changed Expand file tree Collapse file tree 2 files changed +12
-9
lines changed Original file line number Diff line number Diff line change @@ -37,10 +37,6 @@ pypi-setup:
3737develop : pypi-setup
3838 $(PIP ) install -e .
3939
40- # : Install mathics
41- install :
42- $(PYTHON ) setup.py install
43-
4440# Run tests
4541check : pytest
4642
Original file line number Diff line number Diff line change 88session = MathicsSession (character_encoding = "ASCII" )
99
1010
11- def check_evaluation (str_expr : str , expected : str , message = "" ):
12- """Helper function to test that a Mathics expression against
11+ def check_evaluation (str_expr : str , expected : str , assert_message = "" ):
12+ """Helper function to test that a Mathics3 expression against
1313 its results"""
1414 result = session .evaluate (str_expr ).value
1515
16- if message :
17- assert result == expected , f"{ message } : got: { result } "
16+ if assert_message :
17+ print (f"got: { result } , expect: { expected } -- { assert_message } " )
18+ assert result == expected , assert_message
19+ else :
20+ print (f"got: { result } , expect: { expected } " )
21+
22+ if assert_message :
23+ assert result == expected , f"{ assert_message } : got: { result } "
1824 else :
1925 assert result == expected
2026
2127
2228def test_hello ():
2329 session .evaluate ('LoadModule["pymathics.hello"]' ) == "pymathics.hello"
24- check_evaluation ('Hello["World"]' , "Hello, World!" )
30+ check_evaluation ('Hello["everyone"]' , "Hello, everyone!" )
31+ check_evaluation ("Hello[]" , "Hello, World!" )
You can’t perform that action at this time.
0 commit comments