mirror of
https://github.com/wassname/cachier.git
synced 2026-09-10 11:50:23 +08:00
ignoring versioneer in deepsource + retryWrites=False in MongoClient constructor
This commit is contained in:
@@ -4,3 +4,8 @@
|
||||
name = "python"
|
||||
enabled = true
|
||||
runtime_version = "3.x.x"
|
||||
|
||||
exclude_patterns = [
|
||||
"**/versioneer.py",
|
||||
"**/_version.py"
|
||||
]
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
import os
|
||||
|
||||
import cachier
|
||||
from cachier.core import (
|
||||
MAX_WORKERS_ENVAR_NAME,
|
||||
DEFAULT_MAX_WORKERS,
|
||||
@@ -11,6 +12,11 @@ from cachier.core import (
|
||||
)
|
||||
|
||||
|
||||
def test_information():
|
||||
print("\ncachier version: ", end="")
|
||||
print(cachier.__version__)
|
||||
|
||||
|
||||
def test_max_workers():
|
||||
"""Just call this function for coverage."""
|
||||
try:
|
||||
|
||||
@@ -12,6 +12,7 @@ except ImportError: # python 2
|
||||
import Queue as queue
|
||||
|
||||
import pytest
|
||||
import pymongo
|
||||
from pymongo.mongo_client import MongoClient
|
||||
from pymongo.errors import OperationFailure
|
||||
|
||||
@@ -25,7 +26,7 @@ _TEST_PWD = 'ZGhjO5CQESYJ69U4z65G79YG'
|
||||
|
||||
|
||||
def _get_cachier_db_mongo_client():
|
||||
client = MongoClient(host=_TEST_HOST, port=_TEST_PORT)
|
||||
client = MongoClient(host=_TEST_HOST, port=_TEST_PORT, retryWrites=False)
|
||||
client.cachier_test.authenticate(
|
||||
name=_TEST_USERNAME,
|
||||
password=_TEST_PWD,
|
||||
@@ -49,6 +50,12 @@ def _test_mongetter():
|
||||
|
||||
# === Mongo core tests ===
|
||||
|
||||
|
||||
def test_information():
|
||||
print("\npymongo version: ", end="")
|
||||
print(pymongo.__version__)
|
||||
|
||||
|
||||
@cachier(mongetter=_test_mongetter)
|
||||
def _test_mongo_caching(arg_1, arg_2):
|
||||
"""Some function."""
|
||||
|
||||
Reference in New Issue
Block a user