Ad
  • Default User Avatar

    I've come up with a solution (python) that seems to work for this problem, I pass the test phase but when I do the attempt, it fails seemingly randomly with this error :

    Traceback (most recent call last):
      File "/workspace/default/src/codewars-test/codewars_test/test_framework.py", line 111, in wrapper
        func()
      File "tests.py", line 33, in random_tests
        test.assert_approx_equals(cf_value(arr), expected)
      File "/workspace/default/src/codewars-test/codewars_test/test_framework.py", line 84, in assert_approx_equals
        div = max(abs(actual), abs(expected), 1)
    TypeError: bad operand type for abs(): 'NoneType'
    
    

    The tests are then completly stopped.

    I do return None in some of my code, but it is intended and within the rules (as far as my understanding goes). What surprises me is that this error do not look like an intended response from the test but rather that the assert does not expect a None return, resulting in the testing framework crashing as a whole.