Skip to content

Commit

Permalink
Merge pull request #385 from sbesson/python311
Browse files Browse the repository at this point in the history
Add support for Python 3.11
  • Loading branch information
jburel authored Nov 14, 2023
2 parents 59ad18a + d378c39 commit cf37571
Show file tree
Hide file tree
Showing 12 changed files with 306 additions and 372 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@ jobs:
- '3.8'
- '3.9'
- '3.10'
- '3.11'
os:
- ubuntu-20.04
- ubuntu-22.04
include:
- python-version: '3.8'
os: macos-latest
Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
autodoc_mock_imports = ["omero", "omero_ext", "past", "future",
"Ice", "IceImport", "Glacier2", "pytest",
"appdirs", "IcePy", "omero_version",
"mox3", "IceGrid", "mx", "matplotlib",
"IceGrid", "mx", "matplotlib",
"omero_model_FileAnnotationI",
"omero_model_TimestampAnnotationI",
"omero_model_BooleanAnnotationI",
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ def read(fname):
],
tests_require=[
'pytest',
'mox3',
'pytest-mock',
],
cmdclass={
'devtarget': DevTargetCommand,
Expand Down
10 changes: 9 additions & 1 deletion src/omero/testlib/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@
from omero.rtypes import rstring

from omero.testlib import ITest
from mox3 import mox

import warnings

class AbstractCLITest(ITest):

Expand All @@ -40,9 +41,16 @@ def setup_class(cls):
cls.cli.register("sessions", SessionsControl, "TEST")

def setup_mock(self):
from mox3 import mox
warnings.warn(
"The usage of mox3 is deprecated as of OMERO.py 5.17.0",
DeprecationWarning)
self.mox = mox.Mox()

def teardown_mock(self):
warnings.warn(
"The usage of mox3 is deprecated as of OMERO.py 5.17.0",
DeprecationWarning)
self.mox.UnsetStubs()
self.mox.VerifyAll()

Expand Down
4 changes: 2 additions & 2 deletions src/omero_ext/path.py
Original file line number Diff line number Diff line change
Expand Up @@ -810,7 +810,7 @@ def text(self, encoding=None, errors='strict'):
"""
if encoding is None:
# 8-bit
with self.open('U') as f:
with self.open('r') as f:
return f.read()
else:
# Unicode
Expand Down Expand Up @@ -934,7 +934,7 @@ def lines(self, encoding=None, errors='strict', retain=True):
.. seealso:: :meth:`text`
"""
if encoding is None and retain:
with self.open('U') as f:
with self.open('r') as f:
return f.readlines()
else:
return self.text(encoding, errors).splitlines(retain)
Expand Down
130 changes: 0 additions & 130 deletions test/unit/clitest/mocks.py

This file was deleted.

Loading

0 comments on commit cf37571

Please sign in to comment.