Skip to content

Commit

Permalink
Fix run_all_tests on Mac
Browse files Browse the repository at this point in the history
  • Loading branch information
qstokkink committed Mar 6, 2024
1 parent fc87f48 commit 746defb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
6 changes: 2 additions & 4 deletions .github/workflows/unittests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,8 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.8'
python-version: '3.12'
cache: 'pip'
- run: python -m pip install -r requirements.txt
- name: Run unit tests
run: |
pip install pytest pytest-xdist
pytest -n auto ipv8
run: python run_all_tests.py -a
5 changes: 3 additions & 2 deletions run_all_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ def windows_missing_libsodium() -> bool:
# Try to find it in the local directory. This is where we'll download it anyway.
os.add_dll_directory(os.path.dirname(__file__) or os.path.abspath('.'))
try:
import libnacl # noqa: F401, F811
import libnacl # noqa: F401
return False
except OSError:
return True
Expand Down Expand Up @@ -331,7 +331,8 @@ def windows_missing_libsodium() -> bool:
print(f"Launching in {process_count} processes ... awaiting results ... \033[s", end="", flush=True) # noqa: T201

with ProgrammerDistractor(not args.noanimation) as programmer_distractor:
with ProcessPoolExecutor(max_workers=process_count) as executor:
with ProcessPoolExecutor(max_workers=process_count,
mp_context=multiprocessing.get_context("spawn")) as executor:
result = executor.map(task_test, test_class_names, chunksize=len(test_class_names) // process_count + 1)
for process_output_handle in result:
failed, tests_run, time_taken, event_log, print_output = process_output_handle
Expand Down

0 comments on commit 746defb

Please sign in to comment.