Skip to main content

Utilities for interacting with omegaUp

Project description

omegaUp

Library for interacting with omegaUp.

omegaup.validator.validatortest

Allows an input validator to be modeled as a standard unit test.

To use, write your validator as if it were a normal unittest.TestCase:

import logging
import unittest
import sys

from omegaup.validator import validatortest


class MyTest(unittest.TestCase):
  def test_foo(self):
    contestant_output = sys.stdin
    case_name = sys.argv[1]
    with open('data.in', 'r') as original_input, \
         open('data.out', 'r') as original_output:
        logging.info('This will be printed to stderr')

        self.assertAlmostEqual(
            float(contestant_output.readline().strip()),
            float(original_output.readline().strip()))


if __name__ == '__main__':
    validatortest.main()

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

omegaup-2.0.18.tar.gz (75.5 kB view details)

Uploaded Source

Built Distribution

omegaup-2.0.18-py3-none-any.whl (76.2 kB view details)

Uploaded Python 3

File details

Details for the file omegaup-2.0.18.tar.gz.

File metadata

  • Download URL: omegaup-2.0.18.tar.gz
  • Upload date:
  • Size: 75.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for omegaup-2.0.18.tar.gz
Algorithm Hash digest
SHA256 c0c8c5da94544eb1b490aeaccf03c4489e7c27551947a77ace9641ec061af28a
MD5 90731aab02334a60f00b689a72f56266
BLAKE2b-256 6f776e64b6dff915e33840d5818f0478f1f0b602813c5e91e09baff456d2e5af

See more details on using hashes here.

File details

Details for the file omegaup-2.0.18-py3-none-any.whl.

File metadata

  • Download URL: omegaup-2.0.18-py3-none-any.whl
  • Upload date:
  • Size: 76.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for omegaup-2.0.18-py3-none-any.whl
Algorithm Hash digest
SHA256 c9de8b76ea8f38ecdadbb2f8f052dfaac9b9eff41f0250486215958113f48736
MD5 c296d93a8cf61e97fe59c6f15e36df38
BLAKE2b-256 4de6aa5f5d8b8ca0b03bd4e388fd9735d6d11e142a0fe1406a3cead45dc94ba3

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