remove references to nose

This commit is contained in:
Bastien Gérard
2019-09-01 15:27:11 +03:00
parent bc0c55e49a
commit 799cdafae6
10 changed files with 37 additions and 61 deletions

View File

@@ -5,7 +5,7 @@ import tempfile
import unittest
import gridfs
from nose.plugins.skip import SkipTest
import pytest
import six
from mongoengine import *
@@ -21,6 +21,8 @@ except ImportError:
from tests.utils import MongoDBTestCase
require_pil = pytest.mark.skipif(not HAS_PIL, reason="PIL not installed")
TEST_IMAGE_PATH = os.path.join(os.path.dirname(__file__), "mongoengine.png")
TEST_IMAGE2_PATH = os.path.join(os.path.dirname(__file__), "mongodb_leaf.png")
@@ -377,10 +379,8 @@ class TestFileField(MongoDBTestCase):
assert len(list(files)) == 0
assert len(list(chunks)) == 0
@require_pil
def test_image_field(self):
if not HAS_PIL:
raise SkipTest("PIL not installed")
class TestImage(Document):
image = ImageField()
@@ -411,10 +411,8 @@ class TestFileField(MongoDBTestCase):
t.image.delete()
@require_pil
def test_image_field_reassigning(self):
if not HAS_PIL:
raise SkipTest("PIL not installed")
class TestFile(Document):
the_file = ImageField()
@@ -428,10 +426,8 @@ class TestFileField(MongoDBTestCase):
test_file.save()
assert test_file.the_file.size == (45, 101)
@require_pil
def test_image_field_resize(self):
if not HAS_PIL:
raise SkipTest("PIL not installed")
class TestImage(Document):
image = ImageField(size=(185, 37))
@@ -451,10 +447,8 @@ class TestFileField(MongoDBTestCase):
t.image.delete()
@require_pil
def test_image_field_resize_force(self):
if not HAS_PIL:
raise SkipTest("PIL not installed")
class TestImage(Document):
image = ImageField(size=(185, 37, True))
@@ -474,10 +468,8 @@ class TestFileField(MongoDBTestCase):
t.image.delete()
@require_pil
def test_image_field_thumbnail(self):
if not HAS_PIL:
raise SkipTest("PIL not installed")
class TestImage(Document):
image = ImageField(thumbnail_size=(92, 18))
@@ -546,11 +538,8 @@ class TestFileField(MongoDBTestCase):
assert putfile == copy.copy(putfile)
assert putfile == copy.deepcopy(putfile)
@require_pil
def test_get_image_by_grid_id(self):
if not HAS_PIL:
raise SkipTest("PIL not installed")
class TestImage(Document):
image1 = ImageField()