pythonwhat 2.29.0
pip install pythonwhat
Released:
Submission correctness tests for Python
Navigation
Unverified details
These details have not been verified by PyPIProject links
Meta
- License: GNU Affero General Public License v3
- Author: Filip Schouwenaars
- Maintainer: Jeroen Hermans
Classifiers
- License
- Operating System
- Programming Language
Project description
pythonwhat
Verify Python code submissions and auto-generate meaningful feedback messages. Originally developed for Python exercises on DataCamp for so-called Submission Correctness Tests, but can also be used independently.
- New to teaching on DataCamp? Check out https://instructor-support.datacamp.com
- To learn what SCTs are and how they work, visit this article specifically.
- For a complete overview of all functionality inside pythonwhat and articles about what to use when, consult https://pythonwhat.readthedocs.io.
Installation
# latest stable version from PyPi
pip install pythonwhat
# latest development version from GitHub
pip install git+https://github.com/datacamp/pythonwhat
Demo
To experiment locally, you can use setup_state()
and write SCTs interactively.
The code throws an error when the underlying checks fail.
# make all checking functions available
from pythonwhat.test_exercise import prep_context
_, ctxt = prep_context()
globals().update(ctxt)
# initialize state with student and solution submission
from pythonwhat.test_exercise import setup_state
setup_state(stu_code = "x = 5", sol_code = "x = 4")
Ex().check_object('x')
# No error: x is defined in both student and solution process
Ex().check_object('x').has_equal_value()
# TestFail: Did you correctly define the variable `x`? Expected `4`, but got `5`.
# Debugging state
Ex()._state # access state object
dir(Ex()._state) # list all elements available in the state object
Ex()._state.student_code # access student_code of state object
To learn how to include an SCT in a DataCamp course, visit https://instructor-support.datacamp.com.
Run tests
pyenv local 3.9.6
pip3.9 install -r requirements-test.txt
pip3.9 install -e .
pytest
Contributing
Bugs? Questions? Suggestions? Create an issue, or contact us!
License
Project details
Unverified details
These details have not been verified by PyPIProject links
Meta
- License: GNU Affero General Public License v3
- Author: Filip Schouwenaars
- Maintainer: Jeroen Hermans
Classifiers
- License
- Operating System
- Programming Language
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file pythonwhat-2.29.0.tar.gz
.
File metadata
- Download URL: pythonwhat-2.29.0.tar.gz
- Upload date:
- Size: 106.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.21
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 812bf30370f772c429d21e293b98397df2875a8d98007d0b2cf9e363f8a44c14 |
|
MD5 | ab5fd262c2ffb4ef7f8ec63b4c9b6f9c |
|
BLAKE2b-256 | fc7f9e54d426f53ac37485b7d548269e3f0239e5f516af3c28470f9fab5d9584 |
File details
Details for the file pythonwhat-2.29.0-py3-none-any.whl
.
File metadata
- Download URL: pythonwhat-2.29.0-py3-none-any.whl
- Upload date:
- Size: 85.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.21
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 684d137133d56ddecdd8307720d8ec3e4ecdc66992bd003a8948216580df2190 |
|
MD5 | 60bc0909fb29d6227556b4cbb0711375 |
|
BLAKE2b-256 | 0588f0204d6e2f82e83d0d75a2940b8cb90df17c996b54dd77e6c42bdd6cb025 |