Skip to main content

my own CS111 grader.

Project description

MyGrader - Your Own CS111 Grader

The MyGrader project is a custom testing framework designed to help you test your user-defined functions efficiently. It generates test cases, runs them against your functions, and provides detailed summaries of the test results. This can be particularly useful for students and developers working on programming assignments.

Installation

To install MyGrader, you can use pip:

pip install mygrader

MyGrader has a set of dependencies that will be automatically installed.

Usage

  1. Define Your User-Defined Function

Begin by defining the user-defined function you want to test. For example, let's say you have a function calculate_new_price that calculates the new price of an item after applying a discount:

def calculate_new_price(old_price):
    # ... (your code here) ...
    return new_price
  1. Use the Tester Class

Utilize the Tester class from MyGrader to test your function. Create a Python script (e.g., test_my_function.py) with the following code:

from mygrader.Tester import Tester


# Define your user-defined function
def calculate_new_price(old_price):


# ... (your code here) ...

# Create a Tester object
tester = Tester(year=2023, runtime_limit=4)

# Run tests for the function using 1000 test cases
tester.run_test(user_func=calculate_new_price, num_test_cases=1000)
  1. View the Test Summary

After running the tests, you'll see a summary of the results. If you set log_option to 'print', the summary will be printed to the console. If you set it to 'write', the summary will be saved to a file named test_summary.md.

Contributing

Contributions to the MyGrader project are welcome! If you encounter issues or have ideas for improvements, please open an issue or submit a pull request on GitHub.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Project Information

Project Status

MyGrader is currently in the alpha development stage. It's actively being worked on and improved. Feel free to contribute and help make it even better!

Project Classifiers

  • Development Status: 3 - Alpha
  • Intended Audience: Developers
  • License: MIT License
  • Programming Language: Python 3.8, 3.9, 3.10, 3.11

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

mygrader-0.3.1.tar.gz (9.5 kB view details)

Uploaded Source

File details

Details for the file mygrader-0.3.1.tar.gz.

File metadata

  • Download URL: mygrader-0.3.1.tar.gz
  • Upload date:
  • Size: 9.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for mygrader-0.3.1.tar.gz
Algorithm Hash digest
SHA256 2224b9d013a3bb81ee4a83b9268f0fa9322cea8b67ada1c203bd8208b80f9bc9
MD5 153194626aa16d5ce96575c13fdef406
BLAKE2b-256 886f42736c06ff1372931860efc4c024b6e14d0b6bb494308440b81a34b7d16a

See more details on using hashes here.

Supported by

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