Skip to content

Commit

Permalink
Bump to version 1.0.0d
Browse files Browse the repository at this point in the history
- okay this is running and passing on my MacOS 14.13.1 using python3. Not sure what's up with the github actions image of macos.
  • Loading branch information
carlkidcrypto committed Mar 5, 2024
1 parent 049b6b5 commit 895689b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = ezsnmp
version = 1.0.0c
version = 1.0.0d
description = A blazingly fast and Pythonic SNMP library based on the official Net-SNMP bindings.
author = Carlos Santos
author_email = [email protected]
Expand Down
2 changes: 1 addition & 1 deletion sphinx_docs_build/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
author = "carlkidcrypto"

# The full version, including alpha/beta/rc tags
release = "V0.1.0c"
release = "V0.1.0d"


# -- General configuration ---------------------------------------------------
Expand Down
13 changes: 10 additions & 3 deletions tests/test_multi_proc_thread.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@

NUM_PROCESSORS = multiprocessing.cpu_count()

print(f"\nNumber of processors: {NUM_PROCESSORS}")


@pytest.mark.parametrize(
"workers", [1, int(NUM_PROCESSORS / 2), NUM_PROCESSORS, 2 * NUM_PROCESSORS]
Expand All @@ -20,6 +18,10 @@
"jobs", [1, int(NUM_PROCESSORS / 2), NUM_PROCESSORS, 2 * NUM_PROCESSORS]
)
def test_session_threaded(sess_args, workers, jobs):
"""
Ensure that sessions can work when using multiple threads.
"""

def do_work(sess_args):

try:
Expand Down Expand Up @@ -56,6 +58,7 @@ def do_work(sess_args):
future.result()


# Worker class for the test_session_multiprocess test
class Worker:
def __init__(self, sess_args):
self.sess_args = sess_args
Expand Down Expand Up @@ -97,8 +100,12 @@ def __call__(self, _):
"jobs", [1, int(NUM_PROCESSORS / 2), NUM_PROCESSORS, 2 * NUM_PROCESSORS]
)
def test_session_multiprocess(sess_args, workers, jobs):
"""
Ensure that sessions can work when using multiple processes.
"""

sess_types = [SESS_V1_ARGS, SESS_V2_ARGS, SESS_V3_ARGS]
with concurrent.futures.ProcessPoolExecutor(max_workers=workers) as executor:
sess_types = [SESS_V1_ARGS, SESS_V2_ARGS, SESS_V3_ARGS]
sess_type = randint(0, 2)
worker = Worker(sess_types[sess_type])
futures = [executor.submit(worker, sess_args) for _ in range(jobs)]
Expand Down

0 comments on commit 895689b

Please sign in to comment.