__init__.py 953 Bytes
Newer Older
liuzhe-lz's avatar
liuzhe-lz committed
1
2
3
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.

4
5
6
7
"""
Unit test of NNI Python modules.

Test cases of each module should be placed at same path of their source files.
liuzhe-lz's avatar
liuzhe-lz committed
8
For example if `nni/tool/annotation` has one test case, it should be placed at `test/ut/tool/test_annotation.py`;
9
10
11
12
13
if it has multiple test cases, they should be placed in `test/ut/tool/annotation/` directory.

"Legacy" test cases carried from NNI v1.x might not follow above convention:

  + Directory `sdk` contains old test cases previously in `src/sdk/pynni/tests`.
liuzhe-lz's avatar
liuzhe-lz committed
14
  + Directory `tools/nnictl` contains old test cases previously in `tools/nni_cmd/tests`.
15
16
17
  + Directory `tools/annotation` contains old test cases previously in `tools/nni_annotation`.
  + Directory `tools/trial_tool` contains old test cases previously in `tools/nni_trial_tool/test`.
"""
liuzhe-lz's avatar
liuzhe-lz committed
18
19
20
21
22

import os

os.environ['NNI_PLATFORM'] = 'unittest'
os.environ['NNI_TRIAL_JOB_ID'] = 'test_trial_job_id'