Python sys._called_from_test() Examples

The following are code examples for showing how to use sys._called_from_test(). They are extracted from open source Python projects. You can vote up the examples you like or vote down the ones you don't like. You can also save this page to your account.

Example 1
Project: gloss   Author: openhealthcare   File: conftest.py    (license) View Source Project 5 votes vote down vote up
def pytest_configure(config):
    import sys
    sys._called_from_test = True 
Example 2
Project: EMFT   Author: 132nd-etcher   File: conftest.py    (license) View Source Project 5 votes vote down vote up
def pytest_configure(config):
    sys._called_from_test = True


# noinspection PyUnusedLocal,SpellCheckingInspection 
Example 3
Project: statsnba-playbyplay   Author: ethanluoyc   File: conftest.py    (license) View Source Project 5 votes vote down vote up
def pytest_configure(config):
    sys._called_from_test = True 
Example 4
Project: do   Author: rapydo   File: conftest.py    (license) View Source Project 5 votes vote down vote up
def pytest_configure(config):
    import sys
    sys._called_from_test = True 
Example 5
Project: ece5745-sec-pymtl-cl   Author: cornell-ece5745   File: conftest.py    (license) View Source Project 5 votes vote down vote up
def pytest_configure(config):
  import sys
  sys._called_from_test = True 
Example 6
Project: spiking-mlp   Author: petered   File: conftest.py    (license) View Source Project 5 votes vote down vote up
def pytest_configure(config):
    import sys
    sys._called_from_test = True 
Example 7
Project: spiking-mlp   Author: petered   File: conftest.py    (license) View Source Project 5 votes vote down vote up
def pytest_unconfigure(config):
    if hasattr(sys, '_called_from_test'):
        del sys._called_from_test 
Example 8
Project: artemis   Author: QUVA-Lab   File: test_mode.py    (license) View Source Project 5 votes vote down vote up
def is_test_mode():
    return _TEST_MODE or (hasattr(sys, '_called_from_test') and sys._called_from_test) 
Example 9
Project: artemis   Author: QUVA-Lab   File: conftest.py    (license) View Source Project 5 votes vote down vote up
def pytest_configure(config):
    sys._called_from_test = True
    if os.environ.get('TRAVIS'):
        import matplotlib
        matplotlib.use('Agg') 
Example 10
Project: artemis   Author: QUVA-Lab   File: conftest.py    (license) View Source Project 5 votes vote down vote up
def pytest_unconfigure(config):
    if hasattr(sys, '_called_from_test'):
        del sys._called_from_test 
Example 11
Project: mindpark   Author: danijar   File: conftest.py    (license) View Source Project 5 votes vote down vote up
def pytest_configure(config):
    sys._called_from_test = True 
Example 12
Project: how-was-your-day   Author: showerbugs   File: conftest.py    (license) View Source Project 5 votes vote down vote up
def pytest_configure(config):
    sys._called_from_test = True