From 7856f751d54ffbb21dc86dd2797285bc4169096d Mon Sep 17 00:00:00 2001 From: Dave Brondsema Date: Wed, 9 Oct 2024 14:27:59 -0400 Subject: [PATCH 1/3] Quieter test output. Unfortunately tox still shows output in red because unittest command outputs progress to stderr and tox shows stderr in red :( --- ming/tests/test_datastore.py | 6 +++++- ming/tests/test_declarative.py | 2 -- tox.ini | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/ming/tests/test_datastore.py b/ming/tests/test_datastore.py index ba38ad6..5a1ed8f 100644 --- a/ming/tests/test_datastore.py +++ b/ming/tests/test_datastore.py @@ -1,4 +1,6 @@ +import io import sys +from contextlib import redirect_stderr from unittest import TestCase, main from unittest.mock import patch, Mock @@ -43,8 +45,10 @@ def Connection(*a,**kw): raise ConnectionFailure() engine = Engine(Connection, (), {}, 17, True, _sleep=lambda x:None) - self.assertRaises(ConnectionFailure, engine.connect) + with redirect_stderr(io.StringIO()) as stderr: + self.assertRaises(ConnectionFailure, engine.connect) self.assertEqual(failures[0], 18) + assert 'ConnectionFailure' in stderr.getvalue() class TestEngineMim(TestCase): diff --git a/ming/tests/test_declarative.py b/ming/tests/test_declarative.py index 7be426d..22ff3df 100644 --- a/ming/tests/test_declarative.py +++ b/ming/tests/test_declarative.py @@ -207,8 +207,6 @@ def test_ensure_indexes(self): collection = self.MockSession.db[self.MyDoc.m.collection_name] create_index = collection.create_index args = create_index.call_args_list - for a in args: - print(a) indexes = [ ( ([ ('test1', pymongo.ASCENDING), ('test2', pymongo.ASCENDING) ],), dict(unique=False, sparse=False, background=True) ), diff --git a/tox.ini b/tox.ini index c1a8ea7..5aadd9f 100644 --- a/tox.ini +++ b/tox.ini @@ -15,7 +15,7 @@ deps = pymongo3: pymongo<4 pymongo4: pymongo>=4 commands = - coverage run --source ming -m unittest discover -v + coverage run --source ming -m unittest discover - coverage report - coverage xml From eaea6316f71045c94a8e3f39593c345e306f7282 Mon Sep 17 00:00:00 2001 From: Dave Brondsema Date: Wed, 9 Oct 2024 14:29:51 -0400 Subject: [PATCH 2/3] drop python 3.8 support --- .github/workflows/main.yml | 1 - setup.py | 3 +-- tox.ini | 2 +- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 4d4bf9d..186e10c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -22,7 +22,6 @@ jobs: fail-fast: false matrix: python-version: - - 3.8 - 3.9 - '3.10' - '3.11' diff --git a/setup.py b/setup.py index 448b30b..dbe798f 100644 --- a/setup.py +++ b/setup.py @@ -18,13 +18,12 @@ 'Topic :: Database', 'Topic :: Software Development :: Libraries :: Python Modules', 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.8', 'Programming Language :: Python :: 3.9', 'Programming Language :: Python :: 3.10', 'Programming Language :: Python :: 3.11', 'Programming Language :: Python :: 3.12', ], # Get strings from http://pypi.python.org/pypi?%3Aaction=list_classifiers - python_requires='>=3.8', + python_requires='>=3.9', keywords='mongo, pymongo', author='Rick Copeland', author_email='rick@geek.net', diff --git a/tox.ini b/tox.ini index 5aadd9f..c8f3419 100644 --- a/tox.ini +++ b/tox.ini @@ -1,7 +1,7 @@ [tox] skip_missing_interpreters = True envlist = - py{38,39,310,311,312}-pymongo{3,4},pypy3-pymongo{3,4} + py{39,310,311,312}-pymongo{3,4},pypy3-pymongo{3,4} [testenv] install_command = pip install {opts} {packages} From 1bd8fbd5f831061b8d3f6a4495b5776c815988af Mon Sep 17 00:00:00 2001 From: Dave Brondsema Date: Wed, 9 Oct 2024 14:35:51 -0400 Subject: [PATCH 3/3] pymongo 4.9 has internal changes that break MIM, need to fix it still --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index dbe798f..b853077 100644 --- a/setup.py +++ b/setup.py @@ -33,7 +33,7 @@ include_package_data=True, zip_safe=True, install_requires=[ - "pymongo", + "pymongo<4.9", "pytz", ], tests_require=[