Pythonwhat

Latest version: v2.24.4

Safety actively analyzes 629532 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 4 of 6

2.15.3

Added

- `check_object()` does not check whether the targeted object is specified in the solution process if
student and solution process are identical (as is the case in the `SingleProcessExercise`).
- `has_expr()`, the function used by `has_equal_value()`, `has_equal_output()` and `has_equal_error()` can take an `override` argument,
that causes the solution expression _not_ to run and use the value specified in `override` instead.
For more information, have a look at the 'SingleProcessExercise' article on the documentation.

2.15.2

Removed

- `call()` can no longer be used. Use `Ex().check_function_def().check_call().has_equal_x()` instead.
- `has_key()` and `has_equal_key()` can no longer be used. Use `Ex().check_object().check_keys().has_equal_x()` instead.

2.15.1

- Fixed: `check_keys()` allows for more exotic ways of indexing as well, even though it's needed very rarely

2.15.0

Added

- You can now use `Ex().check_object('df').check_keys('a').has_equal_value()` to test DataFrame columns and dictionary elements.
- You can now use `Ex().check_function_def('my_fun').check_call('f(1,3,4)').has_equal_x()` to check the value, output or error that calling a function generates. Soon, the `call()` syntax, although still supported, will be removed.
- More manual signatures have been added for functions in the `numpy.random` submodule, so SCT authors have to specify `signature=False` less and there is more robust argument matching.

Changed

- Update docs to promote new functions introduced above.
- Messaging has improved: if there is crazy nesting, only the last two 'expand messages' are included. That way, you don't get feedback messages like "Check the first for loop. Check the body. Check the first for loop. Check the body. Check the function. ...".
- The function parser (used by `check_function()`) now also discovers function calls in lists and dictionaries.
- `has_import()` is now more flexible by default, not requiring students to use the same alias.

Removed

- Nothing for now, but the following functions will be discontinued in the future:
+ `test_function_definition()`
+ `test_with()`
+ `test_object_after_expression()`
+ `has_key()` and `has_equal_key()`
+ `call()`

2.14.2

- Add `check_df()` to the API again. Turns out quite a lot of live exercises use it by now!

2.14.1

- Fix issue in `test_data_frame()` if message is not specified.
- Improve messaging in `has_key()` and `has_equal_key()`.

Page 4 of 6

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.