Skip to main content

Installation

pip install autograde.py

Module Interface

Run tests written with unittest against a specified module. Additional options:

  • location of tests (if not in the current directory),
  • fallback module to run the tests against,
  • where to save a CSV of the test results, and
  • config file to specify how results are processed
usage: grader [-h] [--fallback FALLBACK] [--submission SUBMISSION] [--tests TESTS]
              [--test-pattern TEST_PATTERN] [--output OUTPUT] [--log LOG] [--config CONFIG]
              path

positional arguments:
  path                  Module to grade

optional arguments:
  -h, --help            show this help message and exit
  --fallback FALLBACK   Fallback module to grade
  --submission SUBMISSION
                        Submission name to grade.
  --tests TESTS         Path of tests to run. Defaults to ./
  --test-pattern TEST_PATTERN
                        Test name pattern to match. Defaults to "test*.py"
  --output OUTPUT       Output file for report. Defaults to stdout.
  --log LOG             Log file to use. Defaults to stdout.
  --config CONFIG       Config file to use.

Tests Discovery

Tests to run can be located anywhere using a combination of the --tests and --test-pattern args. By default, they are searched for under the current directory and match the test*.py pattern. Tests are discovered using the unittest module.

Running Tests

While tests are running, the script will change to the directory of path. This means that file locations in tests should be relative to the provided path. --fallback helps the module determine all tests that should be run. This is helpful when the code located at path is untrusted and may totally fail the test discovery step.

Config

The grader config can be specified with the --config arg. It is a json file that can specify what happens when a certain test runs or when a certain submission is graded. Individual test configs should be under the "tests" map and the key should be of the form: testFunction (test_filename.TestCaseName). Inividual submission configs should be under the "submissions" map and match the name of the submission. An example format is below:

{
    "tests": {
        "testSimple1 (test_simple.TestSimpleTestCase)": {
            "name": "Simple Test 1",
            "weight": 2
        }
    },
    "names": {
        "submission_name": {
            "name": "custom label here"
        }
    }
}

Metadata

Release files for autograde.py 0.0.2

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

Source distribution (sdist)

Source distribution for autograde.py 0.0.2
File Size Uploaded Provenance
autograde.py-0.0.2.tar.gz 4.8 kB Without provenance Details

Built distribution (wheel)

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

Total release size: 9.6 kB

Release files / autograde.py-0.0.2.tar.gz

Download URL autograde.py-0.0.2.tar.gz
Size 4.8 kB
Tags Source
SHA-256 checksum
How to use checksums
e2f76c87d44d7dadae6f6329b79e4e41859c75f69df1f677cf0f4c887d86a794
BLAKE2b-256 checksum
How to use checksums
24e89bc984b695f567978b1f1adc7b765df9c79ba6c8b5765e0d11514066fbd8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.13

Release files / autograde.py-0.0.2-py3-none-any.whl

Download URL autograde.py-0.0.2-py3-none-any.whl
Size 4.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a63eb900a1251fb61ad2decd67cf418112f18d38d408f117f4b9c9f84ccc86d4
BLAKE2b-256 checksum
How to use checksums
0542f596b5685f0d801a339668d51107594a228fbea97fcfc26e2c983141d357
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.13

Security for autograde.py 0.0.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Release history Release notifications | RSS feed

This release

0.0.2 This release

2 release files No provenance

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