leetcodeDriverPY
A simple driver to allow you to use testcases in your own code :)
If you would like to use this in your project, its a simple as
just doing pip install leetcodeDriverPY
Then once you have done that inside of your python file you will want to do something like this:
top of the file:
from leetcodeDriverPY import driver
inbetween these two segments of code should be your solution class with the solution function inside.
testcases = { # create by doing: 'testcase': answer
'answer': 'correct_solution',
}
driver(solution, testcases)
# ^ solution should be your Solution class REFERENCE (no parentheses) NOT AN INSTANCE OF YOUR CLASS
# testcases should be the testcases that you want to use to test your program.
If you class has more than one function inside you may run into issues, for that reason I added a "optionalFunc" parameter.
This would be how you use it:
# this code is just the code from above but changed to use optionalFunc
testcases = { # create by doing: 'testcase': answer
'answer': 'correct_solution',
}
driver(solution, testcases, optionalFunc=solution.IntToRoman)
# ^ optionalFunc should be your function REFERENCE! (ex: sol.IntToRoman)
# You shouldn't actually call the function.
If you are having issues with the colors, OR just do not like them you can disable them with the "colorless" parameter
# this code is just the code from above but changed to use colorless
testcases = { # create by doing: 'testcase': answer
'answer': 'correct_solution',
}
driver(solution, testcases, optionalFunc=solution.IntToRoman, colorless=True)
# ^ colorless is False by default so if you want to disable colors you would set it to true.
Change Log
0.0.1 (12/30/2022)
- First Release
0.0.2 (12/30/2022)
- I forgot to actually make it work
0.0.3 (12/31/2022)
- I actually did stuff???
- Removed legacy code.
- Added verification to ensure that the correct parameters are filled.
- Separated the big _init_ file into some smaller files.
- Changed the error text from FunctionNotFound.
- Added "optionalFunc" parameter, incase you needed to give a direct reference to your function.
- Updated the README.md to show how to use the optionalFunc parameter.
- Added a print statement to inform you of what function is being used.
- Added a NotEnoughTestcases Error.
- Added a check to confirm that len(testcases) > 1 if it fails then it raises NotEnoughTestcases.
1.0.0 (1/1/2022) (Happy New Year!)
- I just wanted a reason to change the version number to 1.0.0
- Added new "colorless" optional parameter that if set to True will disable all color output.
- Updated README.md with colorless option and fixed some text errors.
1.0.1 (1/1/2022)
- Quick patch (I made a few mistakes in the last update...)
- ^ Problem was related to parameter verification because of this, the "class" parameter is not verified anymore.
- Fixed some typos throughout the package.
1.0.2 (1/1/2022)
- small update with minor bug fixes (typos, etc.)
- fixed some incorrect links on the pypi.org page
1.1.0 (1/2/2022)
- Fixed bold adding extra lines for no reason.
- Changed how classes are now given, this allows a more streamlined process of testing.
- ^ More info in the README
- Removed useless declarations
- Changed the FAILED color to only show when over HALF of the testcases failed instead of just 2
- Added links to PyPI page
-
- some minor changes.
1.1.1 (1/2/2022)
- Fixed bugs
Metadata
Release files for leetcodeDriverPY 1.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| leetcodeDriverPY-1.1.1.tar.gz | 5.3 kB | Without provenance | Details |
Release files / leetcodeDriverPY-1.1.1.tar.gz
| Download URL | leetcodeDriverPY-1.1.1.tar.gz |
|---|---|
| Size | 5.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
12b30e5052df529637906e1b4fef323c5c78d8855f8c5a328ee8dbc33cc515a3
|
|
BLAKE2b-256 checksum How to use checksums |
c04e5c318704bb5687bdeddf60a9f726f20d41b1431afe1ba7be25e839a21605
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.6
|
Security for leetcodeDriverPY 1.1.1
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.
To learn more about protecting yourself from malicious actors, visit our package security documentation.