Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
@pytest.fixture(params=['/{}preprint_providers/?version=2.2&', '/{}providers/preprints/?version=2.2&'])
def url(request):
url = (request.param)
return url.format(API_BASE)
@pytest.fixture
def badger(self):
scores = mock.Mock()
scores.name = 'scores'
special_scores = mock.Mock()
special_scores.name = 'special_scores'
return Badger(scores, special_scores)
@pytest.fixture
def event_handler(self, db):
AppNotifyEventHandler.RETRY_INTERVAL = 0.05
AppNotifyEventHandler.RETRY_TIME_SPAN = (0, 30)
return AppNotifyEventHandler(db)
@pytest.fixture
def kw_only(nbprotocoldict):
return nbprotocoldict['kw_only']
@pytest.fixture(autouse=True)
def fake_project_dir(monkeypatch):
'''
Monkey-patch enough for the main() function to run
'''
real_os_path_exists = os.path.exists
def mock_os_path_exists(path):
if path == os.path.join(MOCK_PROJECT_DIR, 'setup.py'):
return True
else:
return real_os_path_exists(path)
monkeypatch.setattr(os.path, 'exists', mock_os_path_exists)
monkeypatch.setattr(sys, 'argv', ['cibuildwheel', MOCK_PROJECT_DIR])
@pytest.fixture(scope='function', autouse=True)
def destroy_paths():
yield
if os.path.exists(MDROOT):
shutil.rmtree(MDROOT)
# Delete contents of the test file
with open(TESTFILE, 'w') as f:
f.write("")
@pytest.fixture(scope='module')
def patch():
return patchserver.Patch()
@pytest.fixture()
def business(locale):
"""
:param locale:
:return:
"""
return Business(locale)
@pytest.fixture(scope="module")
def startup_and_cleanup():
gdaltest.geojson_drv = ogr.GetDriverByName('GeoJSON')
yield
@pytest.fixture()
def error_message(request):
return {
'messageNumber': request.param,
'message': 'test message',
}