Skip to content

Commit

Permalink
Test for crash
Browse files Browse the repository at this point in the history
  • Loading branch information
malfet committed Mar 5, 2024
1 parent 4784993 commit 497edd1
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/test-macos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: tests

on:
pull_request:
branches:
- hauptzweig

jobs:
run_tests:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: 3.11
- name: Install dependencies
run: |
python -m pip install --upgrade pip
# Use "eager" update strategy in case cached dependencies are outdated
# Using regular install NOT editable install: see GH #3020
pip install --upgrade --upgrade-strategy eager torch scikit-learn pytest
- name: Test with pytest
# Ensure we avoid adding current working directory to sys.path:
# - Use "pytest" over "python -m pytest"
# - Use "append" import mode rather than default "prepend"
run: >
pytest bug-121101.py
10 changes: 10 additions & 0 deletions bug-121101.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import time

import torch
from sklearn.datasets import fetch_california_housing


def test_something():
X, y = fetch_california_housing(return_X_y=True)
torch.tensor(X)
time.sleep(3)

0 comments on commit 497edd1

Please sign in to comment.