Skip to main content

Auto checker

Project description

Nowledgeable exercice check

This module let student check their answers outside nowledgeable, anywhere.

Allows exercices to be run outside the nowledgeable application.

Allow also testing complex applications

Contain also the python exercice unit framework

installation

pip3 install nowledgeable

usage

Exercice checking

Run the following in an exercice containing an exercice with the exercice.yaml specification

nowledgeable run-checks

or

nowledgeable run-checks /path/to/exercice.yaml

Watching for file update and reruning files automatically

nowledgeable watch

using the unit testing library

from python_utils.utils import AnswerTester

tester = AnswerTester() #singleton pattern

## add assertions


tester.print_test_output()

Exemples

imagine you have the following wording :

"Code the function multiply_by_two(x) return 2 * x for each x"

You can use compare_function.

for that you need to :

  1. code the proper function
  2. specify a test_inputs variables which will be fed to the student function and the good one.
def solution(x): return 2 * x

tester = AnswerTester()

test_inputs = [
    [3], # la fonction sera testée avec l'argument x=3
    [-2],# la fonction sera testée avec l'argument x=-2
    [random.randint(-3, 3)] #la fonction sera testée avec un x aléatoire entre -3 et 3
]

tester.compare_functions("nom test", multiply_by_two, solution, test_inputs, "message")

result_status = tester.get_test_output()

result = tester.get_test_output() #A la fin on demande de générer le json

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nowledgeable-0.1.12.tar.gz (39.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nowledgeable-0.1.12-py3-none-any.whl (45.2 kB view details)

Uploaded Python 3

File details

Details for the file nowledgeable-0.1.12.tar.gz.

File metadata

  • Download URL: nowledgeable-0.1.12.tar.gz
  • Upload date:
  • Size: 39.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.7.1 requests/2.24.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.10

File hashes

Hashes for nowledgeable-0.1.12.tar.gz
Algorithm Hash digest
SHA256 d7f7c50117eff39f88eb012ea903d97244dbeb02a1c5422a68c04f989d6a0379
MD5 9c309e9a738ed3dc9c4082727676672a
BLAKE2b-256 b64fdfdac2410b7ba9dd35ebd9114cf56c6f9492be688b90d4bab68650a9ad56

See more details on using hashes here.

File details

Details for the file nowledgeable-0.1.12-py3-none-any.whl.

File metadata

  • Download URL: nowledgeable-0.1.12-py3-none-any.whl
  • Upload date:
  • Size: 45.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.7.1 requests/2.24.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.10

File hashes

Hashes for nowledgeable-0.1.12-py3-none-any.whl
Algorithm Hash digest
SHA256 1a0b851c316f26934094bbdf99bbe5122da5f5d5de03d2eb59404f41807c7bc6
MD5 acc22a658d9d7a61d1703b8151995d58
BLAKE2b-256 90aaa1b616a2e269f6807fa6c7c566ad9c75ecd11e117eec6af9c4ca5a169c1f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page