Skip to main content

cp-upsolve-helper

https://pypi.org/project/cp-upsolve-helper/0.0.1/

Usage

if on local

pip install .

from pypi

pip install cp-upsolve-helper==0.0.1
import uthelper.helpers as helper
import unittest

@helper.run
class TestClass(unittest.TestCase):
    def test_example(self):
        self.assertEqual(True, True)

class TestClassDoesntRun(unittest.TestCase):
    def test_example_doesnt_run(self):
        self.assertEqual(True, False)

defining custom solution function and testing

import cphelper.helpers as cphelper

inp_str = """
8
2 3
1 2
3 11
1 5
5 10
4 6
3 9
250000000 500000000
"""

expected_output = """
6
4
33
25
20
12
27
1000000000
"""

r = cphelper.Runner(inp_str, [cphelper.MUL])


def solution(a, b):
    if a == 2 and b == 3:
        return 6
    return 0

r.test_solution(solution, expected_output)

output: note, passes the first case, fails on the others

F
======================================================================
FAIL: test_function (cphelper.helpers.Runner.test_solution.<locals>._.test_function)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/opt/homebrew/anaconda3/lib/python3.11/site-packages/cphelper/helpers.py", line 67, in test_function
    sself.assertEqual(result, expected)
AssertionError: '0' != '4'
- 0
+ 4


----------------------------------------------------------------------
Ran 1 test in 0.001s

FAILED (failures=1)

Metadata

Release files for cp-upsolve-helper 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 cp-upsolve-helper 0.0.2
File Size Uploaded
cp_upsolve_helper-0.0.2.tar.gz 3.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for cp-upsolve-helper 0.0.2
File Interpreter ABI Platform
cp_upsolve_helper-0.0.2-py3-none-any.whl Python 3 none any Details

Total release size: 7.3 kB

Release files / cp_upsolve_helper-0.0.2.tar.gz

Download URL cp_upsolve_helper-0.0.2.tar.gz
Size 3.1 kB
Tags Source
SHA-256 checksum
How to use checksums
d935bb82dc6cf912cb4bee24ae2259fbf9c8eeabbbc9f1eb17d7b448b0b1cab8
BLAKE2b-256 checksum
How to use checksums
24aac39e3fb7a80f078031148b69ee7b90560e8ab21932da2f473003e9f0fa96
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.6

Release files / cp_upsolve_helper-0.0.2-py3-none-any.whl

Download URL cp_upsolve_helper-0.0.2-py3-none-any.whl
Size 4.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6461291ae0fa7593f69c284b367ea9268333b5805d74f64625293585c5cb4289
BLAKE2b-256 checksum
How to use checksums
2c4cf58cf46445d4130ed9b85b49148532ef9cf20804614090c24610aeeb0031
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.6

Release history Release notifications | RSS feed

This release

0.0.2 This release

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