Skip to content

Commit

Permalink
Testing: avoid global fixture for doctests
Browse files Browse the repository at this point in the history
  • Loading branch information
jakevdp committed Apr 8, 2021
1 parent 438b56c commit cee3af5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/ci-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,8 @@ jobs:
run: |
pip install -r docs/requirements.txt
- name: Test documentation
env:
XLA_FLAGS: "--xla_force_host_platform_device_count=8"
run: |
pytest -n 1 docs
pytest -n 1 --doctest-modules --ignore=jax/experimental/jax2tf jax
8 changes: 0 additions & 8 deletions conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@

import jax
import numpy
import os
import pytest


Expand All @@ -25,10 +24,3 @@ def add_imports(doctest_namespace):
doctest_namespace["lax"] = jax.lax
doctest_namespace["jnp"] = jax.numpy
doctest_namespace["np"] = numpy


@pytest.fixture(autouse=True)
def spoof_devices(doctest_namespace):
# Set up runtime to mimic an 8-core machine
flags = os.environ.get('XLA_FLAGS', '')
os.environ['XLA_FLAGS'] = flags + " --xla_force_host_platform_device_count=8"

0 comments on commit cee3af5

Please sign in to comment.