Skip to content

Commit

Permalink
Fix macOS spawning issue in tests, expand testing frameworks
Browse files Browse the repository at this point in the history
  • Loading branch information
nateprewitt committed Apr 2, 2024
1 parent 123ff16 commit c80b5b1
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/run-crt-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,12 @@ on:

jobs:
build:
runs-on: ubuntu-latest
runs-on: '${{ matrix.os }}'
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
os: [ubuntu-latest, macOS-latest, windows-latest]

steps:
- uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ permissions:

jobs:
build:

runs-on: ubuntu-latest
runs-on: '${{ matrix.os }}'
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
os: [ubuntu-latest, macOS-latest, windows-latest]

steps:
- uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3
Expand Down
8 changes: 8 additions & 0 deletions tests/unit/test_compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,14 @@ def test_non_file_like_obj(self):

class TestBaseManager(unittest.TestCase):
def create_pid_manager(self):
if sys.platform == "darwin":
# Starting in Python 3.8, the default multiprocessing
# moved from `fork` to `spawn` to account for how macOS
# handles (or doesn't) forking. Users who are hitting this
# issue _may_ consider changing the start_method after
# reviewing this issue.
# https://github.com/python/cpython/issues/77906
multiprocessing.set_start_method("fork")
class PIDManager(BaseManager):
pass

Expand Down

0 comments on commit c80b5b1

Please sign in to comment.