Skip to main content

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

Metadata

Release files for nowledgeable 0.1.12

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for nowledgeable 0.1.12
File Size Uploaded
nowledgeable-0.1.12.tar.gz 39.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for nowledgeable 0.1.12
File Interpreter ABI Platform
nowledgeable-0.1.12-py3-none-any.whl Python 3 none any Details

Total release size: 84.9 kB

Release files / nowledgeable-0.1.12.tar.gz

Download URL nowledgeable-0.1.12.tar.gz
Size 39.7 kB
Tags Source
SHA-256 checksum
How to use checksums
d7f7c50117eff39f88eb012ea903d97244dbeb02a1c5422a68c04f989d6a0379
BLAKE2b-256 checksum
How to use checksums
b64fdfdac2410b7ba9dd35ebd9114cf56c6f9492be688b90d4bab68650a9ad56
Upload date
Uploaded using Trusted Publishing?
What is 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

Release files / nowledgeable-0.1.12-py3-none-any.whl

Download URL nowledgeable-0.1.12-py3-none-any.whl
Size 45.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1a0b851c316f26934094bbdf99bbe5122da5f5d5de03d2eb59404f41807c7bc6
BLAKE2b-256 checksum
How to use checksums
90aaa1b616a2e269f6807fa6c7c566ad9c75ecd11e117eec6af9c4ca5a169c1f
Upload date
Uploaded using Trusted Publishing?
What is 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

Release history Release notifications | RSS feed

This release

0.1.12 This release

2 release files

0.1.11

2 release files

0.1.10

2 release files

0.1.9

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

0.0.21

2 release files

0.0.20

2 release files

0.0.19

2 release files

0.0.18

2 release files

0.0.17

2 release files

0.0.16

2 release files

0.0.15

2 release files

0.0.14

2 release files

0.0.13

2 release files

0.0.12

2 release files

0.0.11

2 release files

0.0.10

2 release files

0.0.9

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page