Skip to content

Commit

Permalink
Merge pull request #202 from asmacdo/add-3.13
Browse files Browse the repository at this point in the history
Add testing for Python 3.13
  • Loading branch information
asmacdo authored Oct 24, 2024
2 parents 474bab8 + 320f0af commit c9ff794
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 6 deletions.
1 change: 1 addition & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ jobs:
- '3.10'
- '3.11'
- '3.12'
- '3.13'
- 'pypy-3.9'
- 'pypy-3.10'
toxenv: [py]
Expand Down
1 change: 1 addition & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ classifiers =
Programming Language :: Python :: 3.10
Programming Language :: Python :: 3.11
Programming Language :: Python :: 3.12
Programming Language :: Python :: 3.13
Programming Language :: Python :: Implementation :: CPython
Programming Language :: Python :: Implementation :: PyPy
License :: OSI Approved :: MIT License
Expand Down
21 changes: 16 additions & 5 deletions test/test_execution.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,11 +213,22 @@ def runner() -> int:

thread = threading.Thread(target=runner)
thread.start()
sleep(0.3) # make sure the process is started
ps_command = "ps aux | grep '[s]leep 60.74016230000801'" # brackets to not match grep process
ps_output = subprocess.check_output(ps_command, shell=True).decode()
pid = int(ps_output.split()[1])
os.kill(pid, signal.SIGTERM)
retries = 20
pid = None
for i in range(retries):
try:
ps_command = "ps auxww | grep '[s]leep 60.74016230000801'" # brackets to not match grep process
ps_output = subprocess.check_output(ps_command, shell=True).decode()
pid = int(ps_output.split()[1])
break
except subprocess.CalledProcessError as e:
print(f"Attempt {i} failed with msg: {e}", file=sys.stderr)
sleep(0.1) # Retry after a short delay

if pid is not None:
os.kill(pid, signal.SIGTERM)
else:
raise RuntimeError("Failed to find sleep process")

thread.join()
# Cannot retrieve the exit code from the thread, it is written to the file
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist = lint,typing,py38,py39,py310,py311,py312,pypy3
envlist = lint,typing,py39,py310,py311,py312,py313,pypy3
skip_missing_interpreters = True
isolated_build = True
minversion = 3.3.0
Expand Down

0 comments on commit c9ff794

Please sign in to comment.