Skip to content

Testing a function with randomness #147

Open
@oyamad

Description

@oyamad

I think it would be useful if we have a guideline about how to write a unittest for a function that involves randomness.

There are two approaches:

  1. Use np.random.seed
    (Example: test_quad.py, to match the outcomes to those from the CompEcon toolbox?)
  2. Rely on the law of large numbers
    (Example: test_discrete_rv)

Is there any "principle"?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions