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.16.tar.gz (73.6 kB view hashes)

Uploaded Source

Built Distribution

omegaup-2.0.16-py3-none-any.whl (74.3 kB view hashes)

Uploaded Python 3

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