Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test: TestBaseManager no longer works under python 3.8+ #258

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 2 additions & 31 deletions tests/unit/test_compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,11 @@
# language governing permissions and limitations under the License.
import os
import shutil
import signal
import tempfile
from io import BytesIO

from s3transfer.compat import BaseManager, readable, seekable
from tests import skip_if_windows, unittest
from s3transfer.compat import readable, seekable
from tests import unittest


class ErrorRaisingSeekWrapper:
Expand Down Expand Up @@ -75,31 +74,3 @@ def test_readable_file_like_obj(self):

def test_non_file_like_obj(self):
self.assertFalse(readable(object()))


class TestBaseManager(unittest.TestCase):
def create_pid_manager(self):
class PIDManager(BaseManager):
pass

PIDManager.register('getpid', os.getpid)
return PIDManager()

def get_pid(self, pid_manager):
pid = pid_manager.getpid()
# A proxy object is returned back. The needed value can be acquired
# from the repr and converting that to an integer
return int(str(pid))

@skip_if_windows('os.kill() with SIGINT not supported on Windows')
def test_can_provide_signal_handler_initializers_to_start(self):
manager = self.create_pid_manager()
manager.start(signal.signal, (signal.SIGINT, signal.SIG_IGN))
pid = self.get_pid(manager)
try:
os.kill(pid, signal.SIGINT)
except KeyboardInterrupt:
pass
# Try using the manager after the os.kill on the parent process. The
# manager should not have died and should still be usable.
self.assertEqual(pid, self.get_pid(manager))