Caffe2 - Python API
A deep learning, cross platform ML framework
conftest.py
1 from __future__ import absolute_import
2 from __future__ import division
3 from __future__ import print_function
4 from __future__ import unicode_literals
5 
7 
8 
9 def pytest_addoption(parser):
10  parser.addoption(
11  '-G',
12  '--generate-serialized',
13  action='store_true',
14  dest='generate',
15  help='generate output files (default=false, compares to current files)',
16  )
17  parser.addoption(
18  '-O',
19  '--output',
20  default=serial.DATA_DIR,
21  dest='output',
22  help='output directory (default: %(default)s)'
23  )
24  parser.addoption(
25  '-D',
26  '--disable-serialized-check',
27  action='store_true',
28  dest='disable',
29  help='disable checking serialized tests'
30  )
31  parser.addoption(
32  '-C',
33  '--disable-gen-coverage',
34  action='store_true',
35  dest='disable_coverage',
36  help='disable generating coverage markdown file'
37  )
38 
39 
40 def pytest_configure(config):
41  generate = config.getoption('generate', default=False)
42  output = config.getoption('output', default=serial.DATA_DIR)
43  disable = config.getoption('disable', default=False)
44  disable_coverage = config.getoption('disable_coverage', default=False)
45  serial._output_context.__setattr__('should_generate_output', generate)
46  serial._output_context.__setattr__('output_dir', output)
47  serial._output_context.__setattr__('disable_serialized_check', disable)
48  serial._output_context.__setattr__('disable_gen_coverage', disable_coverage)