Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Commit

Permalink
Further cleanup backend tests
Browse files Browse the repository at this point in the history
  • Loading branch information
vandanavk committed Dec 17, 2018
1 parent 64ea1a6 commit da9abd6
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 83 deletions.
7 changes: 3 additions & 4 deletions ci/docker/runtime_functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -939,10 +939,9 @@ unittest_centos7_gpu() {
integrationtest_ubuntu_cpu_onnx() {
set -ex
export PYTHONPATH=./python/
pytest tests/python-pytest/onnx/import/mxnet_backend_test.py
pytest tests/python-pytest/onnx/import/gluon_backend_test.py
pytest tests/python-pytest/onnx/export/onnx_backend_test.py
pytest tests/python-pytest/onnx/export/mxnet_export_test.py
pytest tests/python-pytest/onnx/gluon_backend_test.py
pytest tests/python-pytest/onnx/mxnet_backend_test.py
pytest tests/python-pytest/onnx/mxnet_export_test.py
pytest tests/python-pytest/onnx/test_models.py
pytest tests/python-pytest/onnx/test_node.py
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,29 +21,25 @@
from __future__ import print_function
from __future__ import unicode_literals

import os
import sys
CURR_PATH = os.path.dirname(os.path.abspath(os.path.expanduser(__file__)))
sys.path.insert(0, os.path.join(CURR_PATH, '../'))

import unittest
import backend as mxnet_backend
import backend_test

try:
import onnx.backend.test
except ImportError:
raise ImportError("Onnx and protobuf need to be installed. Instructions to"
+ " install - https://github.com/onnx/onnx#installation")

raise ImportError("Onnx and protobuf need to be installed")

operations = ['import'] # Gluon->ONNX exprot is not supported yet
# This is a pytest magic variable to load extra plugins
pytest_plugins = "onnx.backend.test.report",

BACKEND_TESTS = backend_test.prepare_tests(mxnet_backend, 'import')

# import all test cases at global scope to make them visible to python.unittest
globals().update(BACKEND_TESTS.enable_report().test_cases)
for operation in operations:
mxnet_backend.MXNetBackend.set_params('gluon', operation)
BACKEND_TESTS = backend_test.prepare_tests(mxnet_backend, operation)
# import all test cases at global scope to make them visible to python.unittest
globals().update(BACKEND_TESTS.enable_report().test_cases)

if __name__ == '__main__':
unittest.main()
52 changes: 0 additions & 52 deletions tests/python-pytest/onnx/import/gluon_backend_test.py

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,6 @@
from __future__ import unicode_literals


import os
import sys

CURR_PATH = os.path.dirname(os.path.abspath(os.path.expanduser(__file__)))
sys.path.insert(0, os.path.join(CURR_PATH, '../'))

import unittest
import backend as mxnet_backend
import backend_test
Expand All @@ -37,15 +31,16 @@
except ImportError:
raise ImportError("Onnx and protobuf need to be installed")


mxnet_backend.MXNetBackend.set_params('mxnet', 'export')
operations = ['import', 'export']
# This is a pytest magic variable to load extra plugins
pytest_plugins = "onnx.backend.test.report",

BACKEND_TESTS = backend_test.prepare_tests(mxnet_backend, 'export')

# import all test cases at global scope to make them visible to python.unittest
globals().update(BACKEND_TESTS.enable_report().test_cases)
for operation in operations:
mxnet_backend.MXNetBackend.set_params('mxnet', operation)
BACKEND_TESTS = backend_test.prepare_tests(mxnet_backend, operation)
# import all test cases at global scope to make them visible to python.unittest
globals().update(BACKEND_TESTS.enable_report().test_cases)

if __name__ == '__main__':
unittest.main()
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
"""
# pylint: disable=too-many-locals,wrong-import-position,import-error
from __future__ import absolute_import
import sys
import os
import unittest
import logging
Expand All @@ -33,10 +32,6 @@
from mxnet.contrib import onnx as onnx_mxnet
import mxnet as mx

CURR_PATH = os.path.dirname(os.path.abspath(os.path.expanduser(__file__)))
sys.path.insert(0, os.path.join(CURR_PATH, '../../../python/unittest'))
from common import with_seed

logger = logging.getLogger()
logger.setLevel(logging.DEBUG)

Expand Down

0 comments on commit da9abd6

Please sign in to comment.